mirror of
https://github.com/earendil-works/pi.git
synced 2026-09-29 17:19:06 +08:00
fix(tui): detect Zed terminal capabilities (#8828)
This commit is contained in:
@@ -130,6 +130,21 @@ Add to `keybindings.json`:
|
||||
}
|
||||
```
|
||||
|
||||
## Zed (Integrated Terminal)
|
||||
|
||||
Add these key bindings to your Zed `keymap.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"context": "Terminal",
|
||||
"bindings": {
|
||||
"shift-enter": ["terminal::SendText", "\u001b[13;2u"],
|
||||
"ctrl--": ["terminal::SendText", "\u001b[45;5u"],
|
||||
"ctrl-alt-]": ["terminal::SendText", "\u001b[93;7u"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Windows Terminal
|
||||
|
||||
Pi uses Windows-style keybindings when running natively on Windows or in WSL:
|
||||
|
||||
@@ -110,11 +110,7 @@ function detectCapabilitiesFromEnvironment(tmuxForwardsHyperlink: () => boolean)
|
||||
return { images: null, trueColor: true, hyperlinks: true };
|
||||
}
|
||||
|
||||
if (termProgram === "vscode") {
|
||||
return { images: null, trueColor: true, hyperlinks: true };
|
||||
}
|
||||
|
||||
if (termProgram === "alacritty") {
|
||||
if (termProgram === "alacritty" || termProgram === "vscode" || termProgram === "zed") {
|
||||
return { images: null, trueColor: true, hyperlinks: true };
|
||||
}
|
||||
|
||||
|
||||
@@ -401,6 +401,12 @@ describe("detectCapabilities", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("enables Alacritty capabilities for Zed", () => {
|
||||
withEnv({ TERM_PROGRAM: "zed" }, () => {
|
||||
assert.deepStrictEqual(detectCapabilities(), { images: null, trueColor: true, hyperlinks: true });
|
||||
});
|
||||
});
|
||||
|
||||
it("enables truecolor and hyperlinks for Windows Terminal outside multiplexers", () => {
|
||||
withEnv({ WT_SESSION: "session", TERM: "xterm-256color" }, () => {
|
||||
const caps = detectCapabilities();
|
||||
|
||||
Reference in New Issue
Block a user