@code-yeongyu/senpi-tui 2026.10.24-3 → 2026.10.25-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,15 @@ export interface DetectedTerminalCapabilities extends TerminalCapabilities {
17
17
  heightPx: number;
18
18
  };
19
19
  }
20
+ /**
21
+ * VS Code's integrated terminal normally sets `TERM_PROGRAM=vscode`, but a terminal reached through WSL
22
+ * (or a shell profile that resets it) can arrive with `TERM_PROGRAM` empty (#2826). VS Code sets
23
+ * `VSCODE_IPC_HOOK_CLI` (the `code` CLI's handle) in every integrated terminal, local or remote. Every
24
+ * process started from that terminal inherits it too, including another terminal such as herdr or xterm,
25
+ * so it counts only when `TERM_PROGRAM` is empty: a terminal that sets `TERM_PROGRAM` has claimed the
26
+ * session. Both detectors check this after every other terminal, so a more specific marker wins.
27
+ */
28
+ export declare function isVsCodeTerminal(env?: NodeJS.ProcessEnv): boolean;
20
29
  export declare function outerKittyGraphicsMode(clientTermname: string): "placeholder" | null;
21
30
  export declare function detectTerminalCapabilities(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, execTmux?: TmuxExecFile): DetectedTerminalCapabilities;
22
31
  //# sourceMappingURL=terminal-capabilities.d.ts.map
@@ -1,6 +1,18 @@
1
1
  import { decideTmuxImageCapability, parseTmuxKittyTerminalOverride, } from "./tmux-image-capability.js";
2
2
  import { probeTmuxImageState } from "./tmux-image-probe.js";
3
3
  import { isOldWindowsWezTerm, WEZTERM_WINDOWS_IMAGES_HINT } from "./wezterm-windows-images.js";
4
+ /**
5
+ * VS Code's integrated terminal normally sets `TERM_PROGRAM=vscode`, but a terminal reached through WSL
6
+ * (or a shell profile that resets it) can arrive with `TERM_PROGRAM` empty (#2826). VS Code sets
7
+ * `VSCODE_IPC_HOOK_CLI` (the `code` CLI's handle) in every integrated terminal, local or remote. Every
8
+ * process started from that terminal inherits it too, including another terminal such as herdr or xterm,
9
+ * so it counts only when `TERM_PROGRAM` is empty: a terminal that sets `TERM_PROGRAM` has claimed the
10
+ * session. Both detectors check this after every other terminal, so a more specific marker wins.
11
+ */
12
+ export function isVsCodeTerminal(env = process.env) {
13
+ const termProgram = (env.TERM_PROGRAM ?? "").toLowerCase();
14
+ return termProgram === "vscode" || (termProgram === "" && Boolean(env.VSCODE_IPC_HOOK_CLI));
15
+ }
4
16
  export function outerKittyGraphicsMode(clientTermname) {
5
17
  const term = clientTermname.trim().toLowerCase();
6
18
  return term.includes("kitty") || term.includes("ghostty") || term.includes("warp") ? "placeholder" : null;
@@ -47,14 +59,14 @@ export function detectTerminalCapabilities(env = process.env, platform = process
47
59
  if (env.WT_SESSION) {
48
60
  return { images: null, trueColor: true, hyperlinks: true };
49
61
  }
50
- if (termProgram === "vscode") {
51
- return { images: null, trueColor: true, hyperlinks: true };
62
+ if (term.startsWith("screen")) {
63
+ return { images: null, trueColor, hyperlinks: false };
52
64
  }
53
65
  if (env.CMUX_WORKSPACE_ID || terminalEmulator.includes("JetBrains")) {
54
66
  return { images: null, trueColor: true, hyperlinks: false };
55
67
  }
56
- if (term.startsWith("screen")) {
57
- return { images: null, trueColor, hyperlinks: false };
68
+ if (isVsCodeTerminal(env)) {
69
+ return { images: null, trueColor: true, hyperlinks: true };
58
70
  }
59
71
  // Windows Terminal does not always set WT_SESSION, for example when it hosts
60
72
  // a cmd.exe launched directly from Win+R. Modern Windows consoles support
@@ -1,7 +1,7 @@
1
1
  import { execSync } from "node:child_process";
2
2
  import { isAbsolute } from "node:path";
3
3
  import { pathToFileURL } from "node:url";
4
- import { detectTerminalCapabilities, } from "./terminal-capabilities.js";
4
+ import { detectTerminalCapabilities, isVsCodeTerminal, } from "./terminal-capabilities.js";
5
5
  import { sanitizeTerminalLabel, shortenImagePath } from "./terminal-text.js";
6
6
  import { isOldWindowsWezTerm, WEZTERM_WINDOWS_IMAGES_HINT } from "./wezterm-windows-images.js";
7
7
  export { outerKittyGraphicsMode } from "./terminal-capabilities.js";
@@ -72,7 +72,7 @@ function detectCapabilitiesFromEnvironment(tmuxForwardsHyperlink) {
72
72
  if (process.env.WT_SESSION) {
73
73
  return { images: null, trueColor: true, hyperlinks: true };
74
74
  }
75
- if (termProgram === "alacritty" || termProgram === "vscode" || termProgram === "zed") {
75
+ if (termProgram === "alacritty" || termProgram === "zed") {
76
76
  return { images: null, trueColor: true, hyperlinks: true };
77
77
  }
78
78
  if (terminalEmulator === "jetbrains-jediterm") {
@@ -89,6 +89,10 @@ function detectCapabilitiesFromEnvironment(tmuxForwardsHyperlink) {
89
89
  ...(probedImageProtocol === undefined ? { imageProbe: "kitty" } : {}),
90
90
  };
91
91
  }
92
+ // After every other terminal: the VS Code marker is inherited by terminals started from VS Code (#2826).
93
+ if (isVsCodeTerminal(process.env)) {
94
+ return { images: null, trueColor: true, hyperlinks: true };
95
+ }
92
96
  // Windows Terminal does not always set WT_SESSION, for example when it hosts
93
97
  // a cmd.exe launched directly from Win+R. Modern Windows consoles support
94
98
  // truecolor; keep hyperlinks off unless we positively detected support above.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-yeongyu/senpi-tui",
3
- "version": "2026.10.24-3",
3
+ "version": "2026.10.25-1",
4
4
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",