@deepseek-harness-tui/dsh-tui 0.7.2 → 0.7.3
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.
- package/README.md +1 -1
- package/bin/dsh-tui.js +5 -0
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +6 -1
- package/lib/types/components/HistorySearchDialog.d.ts.map +1 -1
- package/lib/types/components/HistorySearchDialog.js +5 -1
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +5 -1
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +52 -74
- package/lib/types/components/SearchBox.d.ts +4 -0
- package/lib/types/components/SearchBox.d.ts.map +1 -1
- package/lib/types/components/SearchBox.js +101 -2
- package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +4 -1
- package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts.map +1 -1
- package/lib/types/components/Spinner/SpinnerAnimationRow.js +10 -5
- package/lib/types/components/WorkingSpinner.d.ts +3 -1
- package/lib/types/components/WorkingSpinner.d.ts.map +1 -1
- package/lib/types/components/WorkingSpinner.js +2 -2
- package/lib/types/components/design-system/ThemedText.d.ts +7 -1
- package/lib/types/components/design-system/ThemedText.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemedText.js +2 -2
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +52 -8
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +12 -3
- package/lib/types/dsh-adapter/channel.d.ts +10 -0
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +45 -9
- package/lib/types/dsh-adapter/packaged-presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/packaged-presets.js +5 -2
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +7 -3
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +3 -1
- package/lib/types/i18n.d.ts +32 -8
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +9 -3
- package/lib/types/ink/components/Text.d.ts +9 -1
- package/lib/types/ink/components/Text.d.ts.map +1 -1
- package/lib/types/ink/components/Text.js +7 -6
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +4 -2
- package/lib/types/ink/log-update.d.ts.map +1 -1
- package/lib/types/ink/log-update.js +76 -9
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +4 -1
- package/lib/types/ink/terminal.d.ts +40 -4
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +57 -5
- package/lib/types/ink/termio/tokenize.d.ts +6 -0
- package/lib/types/ink/termio/tokenize.d.ts.map +1 -1
- package/lib/types/ink/termio/tokenize.js +18 -4
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +76 -16
- package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
- package/lib/types/screens/SessionBrowser.js +30 -15
- package/lib/types/sessions/view.d.ts.map +1 -1
- package/lib/types/sessions/view.js +13 -1
- package/lib/types/update.d.ts +21 -7
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +66 -16
- package/lib/types/utils/paths.d.ts.map +1 -1
- package/lib/types/utils/paths.js +4 -1
- package/package.json +33 -9
package/lib/types/i18n.d.ts
CHANGED
|
@@ -700,13 +700,41 @@ declare const dict: {
|
|
|
700
700
|
readonly en: "Created {{result}}";
|
|
701
701
|
};
|
|
702
702
|
readonly 'login-api-key': {
|
|
703
|
-
readonly zh: "API key: {{
|
|
704
|
-
readonly en: "API key: {{
|
|
703
|
+
readonly zh: "API key: {{status}}";
|
|
704
|
+
readonly en: "API key: {{status}}";
|
|
705
|
+
};
|
|
706
|
+
readonly 'login-key-configured': {
|
|
707
|
+
readonly zh: "已配置({{ref}})";
|
|
708
|
+
readonly en: "configured ({{ref}})";
|
|
705
709
|
};
|
|
706
710
|
readonly 'login-key-missing': {
|
|
707
711
|
readonly zh: "未配置(DEEPSEEK_API_KEY)";
|
|
708
712
|
readonly en: "not configured (DEEPSEEK_API_KEY)";
|
|
709
713
|
};
|
|
714
|
+
readonly 'login-credentials-unavailable': {
|
|
715
|
+
readonly zh: "无法检查(credentials service 不可用)";
|
|
716
|
+
readonly en: "unavailable (credentials service unavailable)";
|
|
717
|
+
};
|
|
718
|
+
readonly 'login-credential-source': {
|
|
719
|
+
readonly zh: "凭据来源: {{source}}";
|
|
720
|
+
readonly en: "Credential source: {{source}}";
|
|
721
|
+
};
|
|
722
|
+
readonly 'login-source-none': {
|
|
723
|
+
readonly zh: "无";
|
|
724
|
+
readonly en: "none";
|
|
725
|
+
};
|
|
726
|
+
readonly 'login-credential-storage': {
|
|
727
|
+
readonly zh: "凭据存储: {{mode}}";
|
|
728
|
+
readonly en: "Credential storage: {{mode}}";
|
|
729
|
+
};
|
|
730
|
+
readonly 'login-storage-writable': {
|
|
731
|
+
readonly zh: "可写";
|
|
732
|
+
readonly en: "writable";
|
|
733
|
+
};
|
|
734
|
+
readonly 'login-storage-read-only': {
|
|
735
|
+
readonly zh: "只读";
|
|
736
|
+
readonly en: "read-only";
|
|
737
|
+
};
|
|
710
738
|
readonly 'login-base-url': {
|
|
711
739
|
readonly zh: "Base URL: {{url}}";
|
|
712
740
|
readonly en: "Base URL: {{url}}";
|
|
@@ -715,13 +743,9 @@ declare const dict: {
|
|
|
715
743
|
readonly zh: "官方端点";
|
|
716
744
|
readonly en: "official endpoint";
|
|
717
745
|
};
|
|
718
|
-
readonly 'login-source-hint': {
|
|
719
|
-
readonly zh: "来源:环境变量 → 工作区 .env(run.ts 兜底读取)";
|
|
720
|
-
readonly en: "Source: env var → workspace .env (run.ts fallback)";
|
|
721
|
-
};
|
|
722
746
|
readonly 'login-logout-hint': {
|
|
723
|
-
readonly zh: "
|
|
724
|
-
readonly en: "DSH credentials
|
|
747
|
+
readonly zh: "使用 /provider 管理 DSH 凭据;若来源为 env,请删除对应环境变量并重启 dsh-tui";
|
|
748
|
+
readonly en: "Manage DSH credentials with /provider; for env sources, remove the corresponding environment variable and restart dsh-tui";
|
|
725
749
|
};
|
|
726
750
|
readonly 'permissions-policy-hint': {
|
|
727
751
|
readonly zh: "DSH 权限策略由 fs-policy / bash-sandbox 配置决定(当前 leaf:workspace 内读写、写入需已读文件)。";
|
package/lib/types/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAI9B,+DAA+D;AAC/D,eAAO,MAAM,KAAK,uBAAwB,CAAA;AAE1C,QAAA,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,MAAM,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAI9B,+DAA+D;AAC/D,eAAO,MAAM,KAAK,uBAAwB,CAAA;AAE1C,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,QAAQ,EAAE,QAAQ,GAAG,MAAM,IAAI,CAG5D;AAED,qCAAqC;AACrC,wBAAgB,OAAO,IAAI,IAAI,CAE9B;AAED,yDAAyD;AACzD,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAGxC;AAED,iDAAiD;AACjD,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAEpD;AAED;;;;;;GAMG;AACH,wBAAgB,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,UAAe,GAAG,MAAM,CAM/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGzD;AAID;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAS5D;AAED,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,GAAG,GAAE,MAAkB,GAAG,IAAI,GAAG,SAAS,CAMtE;AAED,iDAAiD;AACjD,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,GAAE,MAAkB,GAAG,OAAO,CAQ1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAavC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAIzC"}
|
package/lib/types/i18n.js
CHANGED
|
@@ -197,12 +197,18 @@ const dict = {
|
|
|
197
197
|
'agentsmd-create-failed': { zh: '创建 AGENTS.md 失败', en: 'Failed to create AGENTS.md' },
|
|
198
198
|
'agentsmd-exists': { zh: 'AGENTS.md 已存在,未覆盖', en: 'AGENTS.md already exists, not overwritten' },
|
|
199
199
|
'agentsmd-created': { zh: '已创建 {{result}}', en: 'Created {{result}}' },
|
|
200
|
-
'login-api-key': { zh: 'API key: {{
|
|
200
|
+
'login-api-key': { zh: 'API key: {{status}}', en: 'API key: {{status}}' },
|
|
201
|
+
'login-key-configured': { zh: '已配置({{ref}})', en: 'configured ({{ref}})' },
|
|
201
202
|
'login-key-missing': { zh: '未配置(DEEPSEEK_API_KEY)', en: 'not configured (DEEPSEEK_API_KEY)' },
|
|
203
|
+
'login-credentials-unavailable': { zh: '无法检查(credentials service 不可用)', en: 'unavailable (credentials service unavailable)' },
|
|
204
|
+
'login-credential-source': { zh: '凭据来源: {{source}}', en: 'Credential source: {{source}}' },
|
|
205
|
+
'login-source-none': { zh: '无', en: 'none' },
|
|
206
|
+
'login-credential-storage': { zh: '凭据存储: {{mode}}', en: 'Credential storage: {{mode}}' },
|
|
207
|
+
'login-storage-writable': { zh: '可写', en: 'writable' },
|
|
208
|
+
'login-storage-read-only': { zh: '只读', en: 'read-only' },
|
|
202
209
|
'login-base-url': { zh: 'Base URL: {{url}}', en: 'Base URL: {{url}}' },
|
|
203
210
|
'login-official-endpoint': { zh: '官方端点', en: 'official endpoint' },
|
|
204
|
-
'login-
|
|
205
|
-
'login-logout-hint': { zh: 'DSH 凭证来自环境变量 DEEPSEEK_API_KEY — 删除该环境变量后重启 dsh-tui 即登出', en: 'DSH credentials come from the DEEPSEEK_API_KEY env var — remove it and restart dsh-tui to log out' },
|
|
211
|
+
'login-logout-hint': { zh: '使用 /provider 管理 DSH 凭据;若来源为 env,请删除对应环境变量并重启 dsh-tui', en: 'Manage DSH credentials with /provider; for env sources, remove the corresponding environment variable and restart dsh-tui' },
|
|
206
212
|
'permissions-policy-hint': { zh: 'DSH 权限策略由 fs-policy / bash-sandbox 配置决定(当前 leaf:workspace 内读写、写入需已读文件)。', en: 'DSH permission policy is set by fs-policy / bash-sandbox config (current leaf: read/write in workspace, writes need a prior read).' },
|
|
207
213
|
'permissions-approval-hint': { zh: '审批通道已挂载:命令申请权限提升(sandbox_permissions)时弹出审批条,Yes 放行一次、No / Esc 拒绝。', en: 'The approval channel is mounted: sandbox escalations (sandbox_permissions) raise an approval bar — Yes allows once, No / Esc rejects.' },
|
|
208
214
|
'permissions-preset-hint': { zh: '/permission 可查看与切换权限预设(read-only / workspace-write / danger-full-access)。', en: '/permission shows and switches permission presets (read-only / workspace-write / danger-full-access).' },
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
2
|
import type { Color, Styles } from '../styles.js';
|
|
3
|
+
import type { DOMElement } from '../dom.js';
|
|
3
4
|
type BaseProps = {
|
|
4
5
|
/**
|
|
5
6
|
* Change text color. Accepts a raw color value (rgb, hex, ansi).
|
|
6
7
|
*/
|
|
7
8
|
readonly color?: Color;
|
|
9
|
+
/**
|
|
10
|
+
* Ref to the underlying ink-text DOMElement. dsh-tui addition: lets
|
|
11
|
+
* useDeclaredCursor park the native cursor on an inline caret cell without
|
|
12
|
+
* wrapping it in a Box (a wrapper Box changes flex shrink behaviour and
|
|
13
|
+
* breaks wrapped-line layouts).
|
|
14
|
+
*/
|
|
15
|
+
readonly ref?: Ref<DOMElement>;
|
|
8
16
|
/**
|
|
9
17
|
* Same as `color`, but for background.
|
|
10
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAc,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,KAAK,SAAS,GAAG;IACf;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,GAAG,CAAC,EAAE,KAAK,CAAC;CACb,GAAG;IACF,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,KAAK,CAAC;CACb,GAAG;IACF,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,WAAW,CAAC;AAoD5C;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,KAAA,OA6I9B"}
|
|
@@ -54,8 +54,8 @@ const memoizedStylesForWrap = {
|
|
|
54
54
|
* This component can display text, and change its style to make it colorful, bold, underline, italic or strikethrough.
|
|
55
55
|
*/
|
|
56
56
|
export default function Text(t0) {
|
|
57
|
-
const $ = _c(
|
|
58
|
-
const { color, backgroundColor, bold, dim, italic: t1, underline: t2, strikethrough: t3, inverse: t4, wrap: t5, children } = t0;
|
|
57
|
+
const $ = _c(30);
|
|
58
|
+
const { color, backgroundColor, bold, dim, italic: t1, underline: t2, strikethrough: t3, inverse: t4, wrap: t5, children, ref } = t0;
|
|
59
59
|
const italic = t1 === undefined ? false : t1;
|
|
60
60
|
const underline = t2 === undefined ? false : t2;
|
|
61
61
|
const strikethrough = t3 === undefined ? false : t3;
|
|
@@ -180,15 +180,16 @@ export default function Text(t0) {
|
|
|
180
180
|
const textStyles = t14;
|
|
181
181
|
const t15 = memoizedStylesForWrap[wrap];
|
|
182
182
|
let t16;
|
|
183
|
-
if ($[25] !== children || $[26] !== t15 || $[27] !== textStyles) {
|
|
184
|
-
t16 = _jsx("ink-text", { style: t15, textStyles: textStyles, children: children });
|
|
183
|
+
if ($[25] !== children || $[26] !== t15 || $[27] !== textStyles || $[28] !== ref) {
|
|
184
|
+
t16 = _jsx("ink-text", { ref: ref, style: t15, textStyles: textStyles, children: children });
|
|
185
185
|
$[25] = children;
|
|
186
186
|
$[26] = t15;
|
|
187
187
|
$[27] = textStyles;
|
|
188
|
-
$[28] =
|
|
188
|
+
$[28] = ref;
|
|
189
|
+
$[29] = t16;
|
|
189
190
|
}
|
|
190
191
|
else {
|
|
191
|
-
t16 = $[
|
|
192
|
+
t16 = $[29];
|
|
192
193
|
}
|
|
193
194
|
return t16;
|
|
194
195
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ink.d.ts","sourceRoot":"","sources":["../../../src/ink/ink.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAa9C,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAQrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAA4B,KAAK,aAAa,EAAiB,MAAM,uBAAuB,CAAC;AAIpG,OAAO,EAAqG,KAAK,SAAS,EAAgE,KAAK,cA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IAqB1B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,WAAW;CAoCpB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,wBAAgB,UAAU,CAAC,KAAK,GAAE,MAAM,CAAC,UAA0B,GAAG,IAAI,CAsDzE"}
|
package/lib/types/ink/ink.js
CHANGED
|
@@ -31,7 +31,7 @@ import createRenderer from './renderer.js';
|
|
|
31
31
|
import { CharPool, cellAt, createScreen, HyperlinkPool, isEmptyCellAt, migrateScreenPools, StylePool } from './screen.js';
|
|
32
32
|
import { applySearchHighlight } from './searchHighlight.js';
|
|
33
33
|
import { applySelectionOverlay, captureScrolledRows, clearSelection, createSelectionState, extendSelection, findPlainTextUrlAt, getSelectedText, hasSelection, moveFocus, selectLineAt, selectWordAt, shiftAnchor, shiftSelection, shiftSelectionForFollow, startSelection, updateSelection } from './selection.js';
|
|
34
|
-
import { SYNC_OUTPUT_SUPPORTED, supportsExtendedKeys, supportsWin32InputMode, writeDiffToTerminal } from './terminal.js';
|
|
34
|
+
import { isDecstbmSafe, SYNC_OUTPUT_SUPPORTED, supportsExtendedKeys, supportsWin32InputMode, writeDiffToTerminal } from './terminal.js';
|
|
35
35
|
import { CURSOR_HOME, cursorMove, cursorPosition, DISABLE_KITTY_KEYBOARD, DISABLE_MODIFY_OTHER_KEYS, DISABLE_WIN32_INPUT_MODE, ENABLE_KITTY_KEYBOARD, ENABLE_MODIFY_OTHER_KEYS, ENABLE_WIN32_INPUT_MODE, ERASE_SCREEN, SGR_RESET } from './termio/csi.js';
|
|
36
36
|
import { DBP, DFE, DISABLE_MOUSE_TRACKING, ENABLE_MOUSE_TRACKING, ENTER_ALT_SCREEN, EXIT_ALT_SCREEN, SHOW_CURSOR } from './termio/dec.js';
|
|
37
37
|
import { CLEAR_ITERM2_PROGRESS, CLEAR_TAB_STATUS, setClipboard, supportsTabStatus, wrapForMultiplexer } from './termio/osc.js';
|
|
@@ -582,7 +582,9 @@ export default class Ink {
|
|
|
582
582
|
// renders the scrolled-but-not-yet-repainted intermediate state.
|
|
583
583
|
// tmux is the main case (re-emits DECSTBM with its own timing and
|
|
584
584
|
// doesn't implement DEC 2026, so SYNC_OUTPUT_SUPPORTED is false).
|
|
585
|
-
|
|
585
|
+
// JediTerm is separately excluded in isDecstbmSafe(): its DECSTBM
|
|
586
|
+
// implementation deviates from xterm and garbles scrolling content.
|
|
587
|
+
isDecstbmSafe());
|
|
586
588
|
const diffMs = performance.now() - tDiff;
|
|
587
589
|
// Swap buffers
|
|
588
590
|
this.backFrame = this.frontFrame;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-update.d.ts","sourceRoot":"","sources":["../../../src/ink/log-update.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAiB,KAAK,EAAE,MAAM,YAAY,CAAA;AAE5D,OAAO,EASL,KAAK,SAAS,EAGf,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"log-update.d.ts","sourceRoot":"","sources":["../../../src/ink/log-update.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAiB,KAAK,EAAE,MAAM,YAAY,CAAA;AAE5D,OAAO,EASL,KAAK,SAAS,EAGf,MAAM,aAAa,CAAA;AAsBpB,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AAKD;;;GAGG;AACH,qBAAa,SAAS;IAGR,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,KAAK,CAAO;gBAES,OAAO,EAAE,OAAO;IAO7C;;;;;;;;;;;;;;;;;OAiBG;IACH,uBAAuB,IAAI,IAAI;IAI/B;;;;;OAKG;IACH,+BAA+B,CAAC,SAAS,EAAE,KAAK,GAAG,IAAI;IASvD,+HAA+H;IAC/H,KAAK,IAAI,IAAI;IAIb,OAAO,CAAC,eAAe;IAiDvB,OAAO,CAAC,mBAAmB;IAS3B;;;;;;;;OAQG;IACH,MAAM,CACJ,IAAI,EAAE,KAAK,EACX,IAAI,EAAE,KAAK,EACX,SAAS,UAAQ,EACjB,WAAW,UAAO,GACjB,IAAI;CAgbR"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ansiCodesToString, diffAnsiCodes, } from '@alcalzone/ansi-tokenize';
|
|
2
2
|
import { logForDebugging } from '../utils/debug.js';
|
|
3
3
|
import { cellAt, charInCellAt, diffEach, isEmptyCellAt, shiftRows, visibleCellAtIndex, } from './screen.js';
|
|
4
|
-
import { CURSOR_HOME, cursorUp, eraseToEndOfScreen, scrollDown as csiScrollDown, scrollUp as csiScrollUp, RESET_SCROLL_REGION, setScrollRegion, } from './termio/csi.js';
|
|
4
|
+
import { CURSOR_HOME, cursorUp, eraseToEndOfScreen, scrollDown as csiScrollDown, scrollUp as csiScrollUp, RESET_SCROLL_REGION, SGR_RESET, setScrollRegion, } from './termio/csi.js';
|
|
5
|
+
import { isJetBrainsIdeTerminal } from './terminal.js';
|
|
5
6
|
import { LINK_END, link as oscLink } from './termio/osc.js';
|
|
6
7
|
const CARRIAGE_RETURN = { type: 'carriageReturn' };
|
|
7
8
|
const NEWLINE = { type: 'stdout', content: '\n' };
|
|
@@ -425,9 +426,54 @@ export class LogUpdate {
|
|
|
425
426
|
: 'none';
|
|
426
427
|
logForDebugging(`Slow render: ${elapsed.toFixed(1)}ms, screen: ${next.screen.height}x${next.screen.width}, damage: ${damageInfo}, changes: ${screen.diff.length}`);
|
|
427
428
|
}
|
|
428
|
-
|
|
429
|
+
let result = scrollPatch.length > 0
|
|
429
430
|
? [...scrollPatch, ...screen.diff]
|
|
430
431
|
: screen.diff;
|
|
432
|
+
// JetBrains IDE terminals (JediTerm) in main-screen (inline) mode:
|
|
433
|
+
// append a visible-frame rewrite to the incremental diff.
|
|
434
|
+
//
|
|
435
|
+
// JediTerm's reworked block renderer (the default terminal in JetBrains
|
|
436
|
+
// IDEs 2025.2+) repaints a view row only when its model cells change,
|
|
437
|
+
// and it re-renders between writes. The incremental diff above writes
|
|
438
|
+
// only the cells that changed since the previous frame — so a row the
|
|
439
|
+
// block renderer misrendered mid-frame (partial reflow) is never
|
|
440
|
+
// touched again, and the garbage persists and accumulates as the
|
|
441
|
+
// transcript streams and scrolls: the "works in VS Code, slowly garbles
|
|
442
|
+
// in JetBrains" symptom. xterm.js-family terminals (VS Code) repaint
|
|
443
|
+
// the fixed grid on every write, so the same byte stream is clean
|
|
444
|
+
// there; the model-level state is identical on both (verified by
|
|
445
|
+
// replaying captured frame bytes through the IDE's bundled JediTerm
|
|
446
|
+
// emulator against xterm.js) — the divergence is purely the view
|
|
447
|
+
// layer's incremental repaint.
|
|
448
|
+
//
|
|
449
|
+
// The rewrite runs AFTER the incremental writes instead of replacing
|
|
450
|
+
// them: the growth path's CR+LF writes are what scroll scrolled-off
|
|
451
|
+
// rows into the terminal's native scrollback (inline mode's whole
|
|
452
|
+
// point). A pure full-repaint mode would never emit those scrolls and
|
|
453
|
+
// the transcript above the viewport would vanish. Appending a repaint
|
|
454
|
+
// anchored at the visible frame start (CR + CUU(visibleRows) + ED0 +
|
|
455
|
+
// frame tail) overwrites every application cell, forcing the block
|
|
456
|
+
// renderer to a correct full repaint without touching scrollback or
|
|
457
|
+
// shell output above a short frame. The appended slice lands its
|
|
458
|
+
// row-ending CR+LFs inside the viewport so nothing extra scrolls. The
|
|
459
|
+
// anchor prefixes SGR_RESET + link('') so the ED0's BCE fill uses the
|
|
460
|
+
// default background and any hyperlink the incremental writes left open
|
|
461
|
+
// is closed first. Frames that took a full-reset path already repaint
|
|
462
|
+
// everything and are skipped. A one-row viewport has no separate park
|
|
463
|
+
// row, so it keeps the original incremental output. Alt-screen is
|
|
464
|
+
// unaffected: its per-frame CSI H anchor + BSU/ESU atomic frames already
|
|
465
|
+
// keep the block renderer consistent.
|
|
466
|
+
if (!altScreen &&
|
|
467
|
+
isJetBrainsIdeTerminal() &&
|
|
468
|
+
prev.viewport.height > 1 &&
|
|
469
|
+
!result.some(patch => patch.type === 'clearTerminal')) {
|
|
470
|
+
logForDebugging(`JetBrains inline frame: append viewport repaint (height=${next.screen.height}, viewport=${prev.viewport.height})`);
|
|
471
|
+
result = [
|
|
472
|
+
...result,
|
|
473
|
+
...viewportRepaintPatches(prev, next, stylePool, true, 'frame-end'),
|
|
474
|
+
];
|
|
475
|
+
}
|
|
476
|
+
return result;
|
|
431
477
|
}
|
|
432
478
|
}
|
|
433
479
|
function transitionHyperlink(diff, current, target) {
|
|
@@ -507,6 +553,22 @@ function fullResetSequence_CAUSES_FLICKER(frame, reason, stylePool, debug) {
|
|
|
507
553
|
* bottom row, which no known writer produces.)
|
|
508
554
|
*/
|
|
509
555
|
function repaintViewportInPlace(prev, next, stylePool) {
|
|
556
|
+
return viewportRepaintPatches(prev, next, stylePool, false, 'viewport-bottom');
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Patches that rewrite the visible viewport in place, then paint the frame
|
|
560
|
+
* tail top-to-bottom. See repaintViewportInPlace for the layout rationale.
|
|
561
|
+
*
|
|
562
|
+
* When these patches are APPENDED to an incremental diff (rather than being
|
|
563
|
+
* the whole frame), the incremental writes may have left an SGR style and/or
|
|
564
|
+
* an OSC 8 hyperlink open; `resetPrefix` then prepends SGR_RESET + link('')
|
|
565
|
+
* so the ED0 BCE fill and the slice's style/hyperlink transitions start from
|
|
566
|
+
* a clean state. In that path the physical cursor is at the frame end, so a
|
|
567
|
+
* short frame must move up only its visible row count. Moving up V-1 rows
|
|
568
|
+
* would clamp at the terminal top, erase shell history above the application,
|
|
569
|
+
* and relocate the application to the top of the viewport.
|
|
570
|
+
*/
|
|
571
|
+
function viewportRepaintPatches(prev, next, stylePool, resetPrefix, origin) {
|
|
510
572
|
const viewportHeight = prev.viewport.height;
|
|
511
573
|
const height = next.screen.height;
|
|
512
574
|
// The bottom viewport row stays reserved for the cursor park; content
|
|
@@ -514,13 +576,18 @@ function repaintViewportInPlace(prev, next, stylePool) {
|
|
|
514
576
|
// steady state, where the park LF materializes one row below the frame).
|
|
515
577
|
const contentRows = Math.min(height, viewportHeight - 1);
|
|
516
578
|
const startY = height - contentRows;
|
|
517
|
-
//
|
|
518
|
-
//
|
|
519
|
-
//
|
|
520
|
-
//
|
|
521
|
-
//
|
|
522
|
-
//
|
|
523
|
-
|
|
579
|
+
// A standalone recovery starts at the parked physical bottom row and must
|
|
580
|
+
// reach the viewport top. An appended repaint starts at next.cursor (the
|
|
581
|
+
// frame end), so moving up contentRows reaches the actual visible-frame
|
|
582
|
+
// start for both short and overflowing frames without crossing into shell
|
|
583
|
+
// history. Erase down from there (BCE fill — the SGR reset guarantees the
|
|
584
|
+
// default background). The erase also blanks the park row, so no stale
|
|
585
|
+
// prompt/status pixels survive below short content.
|
|
586
|
+
const rowsToStart = origin === 'viewport-bottom' ? viewportHeight - 1 : contentRows;
|
|
587
|
+
const anchor = (resetPrefix ? SGR_RESET + LINK_END : '') +
|
|
588
|
+
'\r' +
|
|
589
|
+
cursorUp(rowsToStart) +
|
|
590
|
+
eraseToEndOfScreen();
|
|
524
591
|
const screen = new VirtualScreen({ x: 0, y: startY }, next.viewport.width);
|
|
525
592
|
renderFrameSlice(screen, next, startY, height, stylePool);
|
|
526
593
|
return [{ type: 'stdout', content: anchor }, ...screen.diff];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-keypress.d.ts","sourceRoot":"","sources":["../../../src/ink/parse-keypress.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAkJtE,gDAAgD;AAChD,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAA;AAEV;;;GAGG;AACH,MAAM,MAAM,gBAAgB;AAC1B,iEAAiE;AAC/D;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MA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G,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED;;6BAE6B;AAC7B,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,UAAU,CAAA;IAChB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,gBAAgB,CAAA;CAC3B,CAAA;AAED;;0DAE0D;AAC1D,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,OAAO,CAAA;IACb;4DACwD;IACxD,MAAM,EAAE,MAAM,CAAA;IACd,2DAA2D;IAC3D,MAAM,EAAE,OAAO,GAAG,SAAS,CAAA;IAC3B,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAA;IACX,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;2EAC2E;AAC3E,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,CAAA"}
|
|
@@ -542,7 +542,10 @@ export function parseMultipleKeypresses(prevState, input = '') {
|
|
|
542
542
|
const isFlush = input === null;
|
|
543
543
|
const inputString = isFlush ? '' : inputToString(input);
|
|
544
544
|
// Get or create tokenizer
|
|
545
|
-
const tokenizer = prevState._tokenizer ?? createTokenizer({
|
|
545
|
+
const tokenizer = prevState._tokenizer ?? createTokenizer({
|
|
546
|
+
x10Mouse: true,
|
|
547
|
+
splitInputControls: true,
|
|
548
|
+
});
|
|
546
549
|
// Tokenize the input
|
|
547
550
|
const tokens = isFlush ? tokenizer.flush() : tokenizer.feed(inputString);
|
|
548
551
|
// Convert tokens to parsed keys, handling paste mode
|
|
@@ -18,6 +18,20 @@ export type Progress = {
|
|
|
18
18
|
* @returns true when the terminal supports OSC 9;4 progress reporting.
|
|
19
19
|
*/
|
|
20
20
|
export declare function isProgressReportingAvailable(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* True when running inside a JetBrains IDE terminal (JediTerm). The IDE
|
|
23
|
+
* injects `TERMINAL_EMULATOR=JetBrains-JediTerm` into the pty environment of
|
|
24
|
+
* its local terminal sessions and sets no TERM_PROGRAM, so this is the only
|
|
25
|
+
* reliable local-JediTerm marker; it is also not forwarded over SSH by
|
|
26
|
+
* default (sshd only sends TERM), matching the local-terminal scope of the
|
|
27
|
+
* behaviors it gates.
|
|
28
|
+
*
|
|
29
|
+
* JediTerm's emulation diverges from xterm.js in exactly the places the
|
|
30
|
+
* renderer cares about (DEC 2026 support, DECSTBM semantics), so it is
|
|
31
|
+
* detected explicitly rather than left to TERM/TERM_PROGRAM fallbacks.
|
|
32
|
+
* @returns true when the process runs in a JetBrains IDE terminal.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isJetBrainsIdeTerminal(): boolean;
|
|
21
35
|
/**
|
|
22
36
|
* Checks if the terminal supports DEC mode 2026 (synchronized output).
|
|
23
37
|
* When supported, BSU/ESU sequences prevent visible flicker during redraws.
|
|
@@ -53,16 +67,23 @@ export declare function supportsExtendedKeys(): boolean;
|
|
|
53
67
|
/**
|
|
54
68
|
* True when win32-input-mode (DECSET 9001, `CSI ? 9001 h`) should drive
|
|
55
69
|
* keyboard input. This is a ConPTY feature — both Windows Terminal and
|
|
56
|
-
* classic conhost switch into it when the app emits the sequence
|
|
57
|
-
*
|
|
58
|
-
*
|
|
70
|
+
* classic conhost switch into it when the app emits the sequence. In this
|
|
71
|
+
* mode every key arrives as a full INPUT_RECORD
|
|
72
|
+
* (`CSI Vk;Sc;Uc;Kd;Cs;Rc _`), the only encoding that
|
|
59
73
|
* preserves Enter's Shift/Ctrl bits on Windows (issue #147). It replaces
|
|
60
74
|
* the kitty/modifyOtherKeys push — callers must treat them as mutually
|
|
61
75
|
* exclusive. Non-ConPTY Windows terminals (mintty via winpty) ignore the
|
|
62
76
|
* unknown private mode and fall back to classic VT input unchanged.
|
|
77
|
+
*
|
|
78
|
+
* Embedded xterm.js hosts may identify as `TERM_PROGRAM=vscode` while using
|
|
79
|
+
* the xterm.js engine version as TERM_PROGRAM_VERSION (Termy 1.4.1 reports
|
|
80
|
+
* 6.0.0). They do not provide native ConPTY's input-mode contract: enabling
|
|
81
|
+
* 9001 can reduce arrows/mouse sequences to their trailing A-D/M bytes and
|
|
82
|
+
* interfere with IME commits (issue #215). Native VS Code reports its own
|
|
83
|
+
* 1.x application version and retains win32-input-mode support.
|
|
63
84
|
* @returns true on native Windows (never in WSL — platform is linux there).
|
|
64
85
|
*/
|
|
65
|
-
export declare function supportsWin32InputMode(): boolean;
|
|
86
|
+
export declare function supportsWin32InputMode(platform?: NodeJS.Platform, termProgram?: string | undefined, termProgramVersion?: string | undefined): boolean;
|
|
66
87
|
/**
|
|
67
88
|
* True if the terminal scrolls the viewport when it receives cursor-up
|
|
68
89
|
* sequences that reach above the visible area. On Windows, conhost's
|
|
@@ -79,6 +100,21 @@ export declare function hasCursorUpViewportYankBug(): boolean;
|
|
|
79
100
|
* so callers can pass a sync-skip hint gated to specific modes.
|
|
80
101
|
*/
|
|
81
102
|
export declare const SYNC_OUTPUT_SUPPORTED: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Whether the DECSTBM hardware-scroll optimization may be used to paint
|
|
105
|
+
* ScrollBox scrolls. Called once per frame — the same env reads as the
|
|
106
|
+
* SYNC_OUTPUT_SUPPORTED gate, so the extra cost is a single comparison.
|
|
107
|
+
*
|
|
108
|
+
* JediTerm is explicitly excluded even though it implements DEC 2026: its
|
|
109
|
+
* scroll-region (DECSTBM) + CSI S/T handling deviates from xterm and, when
|
|
110
|
+
* driven per-frame by a diffing renderer, corrupts the screen progressively
|
|
111
|
+
* as content scrolls (the "JetBrains terminal slowly garbles" bug class).
|
|
112
|
+
* The diff engine falls back to repainting the shifted rows cell-by-cell,
|
|
113
|
+
* which every terminal renders identically. Same gate as upstream Claude
|
|
114
|
+
* Code, which hard-disables DECSTBM on JetBrains terminals.
|
|
115
|
+
* @returns true when DECSTBM scroll optimization is safe on this terminal.
|
|
116
|
+
*/
|
|
117
|
+
export declare function isDecstbmSafe(): boolean;
|
|
82
118
|
/**
|
|
83
119
|
* The output streams a terminal renders to.
|
|
84
120
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../../src/ink/terminal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAKtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAKtC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,eAAe,CAAA;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CAuCtD;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../../src/ink/terminal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAKtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAKtC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,eAAe,CAAA;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,IAAI,OAAO,CAuCtD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,IAAI,OAAO,CAwDvD;AAcD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAGnC;AAyBD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAG9C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,WAAW,GAAE,MAAM,GAAG,SAAoC,EAC1D,kBAAkB,GAAE,MAAM,GAAG,SAA4C,GACxE,OAAO,CAOT;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,SAAkC,CAAA;AAEpE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAuBD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,QAAQ,CAAA;IAChB,MAAM,EAAE,QAAQ,CAAA;CACjB,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,eAAe,UAAQ,GACtB,IAAI,CAqEN"}
|
|
@@ -48,6 +48,22 @@ export function isProgressReportingAvailable() {
|
|
|
48
48
|
}
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* True when running inside a JetBrains IDE terminal (JediTerm). The IDE
|
|
53
|
+
* injects `TERMINAL_EMULATOR=JetBrains-JediTerm` into the pty environment of
|
|
54
|
+
* its local terminal sessions and sets no TERM_PROGRAM, so this is the only
|
|
55
|
+
* reliable local-JediTerm marker; it is also not forwarded over SSH by
|
|
56
|
+
* default (sshd only sends TERM), matching the local-terminal scope of the
|
|
57
|
+
* behaviors it gates.
|
|
58
|
+
*
|
|
59
|
+
* JediTerm's emulation diverges from xterm.js in exactly the places the
|
|
60
|
+
* renderer cares about (DEC 2026 support, DECSTBM semantics), so it is
|
|
61
|
+
* detected explicitly rather than left to TERM/TERM_PROGRAM fallbacks.
|
|
62
|
+
* @returns true when the process runs in a JetBrains IDE terminal.
|
|
63
|
+
*/
|
|
64
|
+
export function isJetBrainsIdeTerminal() {
|
|
65
|
+
return process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
|
|
66
|
+
}
|
|
51
67
|
/**
|
|
52
68
|
* Checks if the terminal supports DEC mode 2026 (synchronized output).
|
|
53
69
|
* When supported, BSU/ESU sequences prevent visible flicker during redraws.
|
|
@@ -71,6 +87,14 @@ export function isSynchronizedOutputSupported() {
|
|
|
71
87
|
termProgram === 'alacritty') {
|
|
72
88
|
return true;
|
|
73
89
|
}
|
|
90
|
+
// JetBrains IDE terminals (JediTerm) implement DEC 2026 synchronized
|
|
91
|
+
// output; TERM_PROGRAM is unset there (only TERMINAL_EMULATOR is), so the
|
|
92
|
+
// env list above never matches. Frames wrapped in BSU/ESU land atomically
|
|
93
|
+
// in JediTerm's reworked block renderer — the same guarantee VS Code gets
|
|
94
|
+
// via TERM_PROGRAM=vscode — which keeps its partial-update reflow from
|
|
95
|
+
// scrambling continuously-updated screens.
|
|
96
|
+
if (isJetBrainsIdeTerminal())
|
|
97
|
+
return true;
|
|
74
98
|
// kitty sets TERM=xterm-kitty or KITTY_WINDOW_ID
|
|
75
99
|
if (term?.includes('kitty') || process.env.KITTY_WINDOW_ID)
|
|
76
100
|
return true;
|
|
@@ -170,17 +194,28 @@ export function supportsExtendedKeys() {
|
|
|
170
194
|
/**
|
|
171
195
|
* True when win32-input-mode (DECSET 9001, `CSI ? 9001 h`) should drive
|
|
172
196
|
* keyboard input. This is a ConPTY feature — both Windows Terminal and
|
|
173
|
-
* classic conhost switch into it when the app emits the sequence
|
|
174
|
-
*
|
|
175
|
-
*
|
|
197
|
+
* classic conhost switch into it when the app emits the sequence. In this
|
|
198
|
+
* mode every key arrives as a full INPUT_RECORD
|
|
199
|
+
* (`CSI Vk;Sc;Uc;Kd;Cs;Rc _`), the only encoding that
|
|
176
200
|
* preserves Enter's Shift/Ctrl bits on Windows (issue #147). It replaces
|
|
177
201
|
* the kitty/modifyOtherKeys push — callers must treat them as mutually
|
|
178
202
|
* exclusive. Non-ConPTY Windows terminals (mintty via winpty) ignore the
|
|
179
203
|
* unknown private mode and fall back to classic VT input unchanged.
|
|
204
|
+
*
|
|
205
|
+
* Embedded xterm.js hosts may identify as `TERM_PROGRAM=vscode` while using
|
|
206
|
+
* the xterm.js engine version as TERM_PROGRAM_VERSION (Termy 1.4.1 reports
|
|
207
|
+
* 6.0.0). They do not provide native ConPTY's input-mode contract: enabling
|
|
208
|
+
* 9001 can reduce arrows/mouse sequences to their trailing A-D/M bytes and
|
|
209
|
+
* interfere with IME commits (issue #215). Native VS Code reports its own
|
|
210
|
+
* 1.x application version and retains win32-input-mode support.
|
|
180
211
|
* @returns true on native Windows (never in WSL — platform is linux there).
|
|
181
212
|
*/
|
|
182
|
-
export function supportsWin32InputMode() {
|
|
183
|
-
|
|
213
|
+
export function supportsWin32InputMode(platform = process.platform, termProgram = process.env.TERM_PROGRAM, termProgramVersion = process.env.TERM_PROGRAM_VERSION) {
|
|
214
|
+
if (platform !== 'win32')
|
|
215
|
+
return false;
|
|
216
|
+
const version = coerce(termProgramVersion);
|
|
217
|
+
const isEmbeddedXtermJs = termProgram === 'vscode' && version !== null && version.major >= 5;
|
|
218
|
+
return !isEmbeddedXtermJs;
|
|
184
219
|
}
|
|
185
220
|
/**
|
|
186
221
|
* True if the terminal scrolls the viewport when it receives cursor-up
|
|
@@ -200,6 +235,23 @@ export function hasCursorUpViewportYankBug() {
|
|
|
200
235
|
* so callers can pass a sync-skip hint gated to specific modes.
|
|
201
236
|
*/
|
|
202
237
|
export const SYNC_OUTPUT_SUPPORTED = isSynchronizedOutputSupported();
|
|
238
|
+
/**
|
|
239
|
+
* Whether the DECSTBM hardware-scroll optimization may be used to paint
|
|
240
|
+
* ScrollBox scrolls. Called once per frame — the same env reads as the
|
|
241
|
+
* SYNC_OUTPUT_SUPPORTED gate, so the extra cost is a single comparison.
|
|
242
|
+
*
|
|
243
|
+
* JediTerm is explicitly excluded even though it implements DEC 2026: its
|
|
244
|
+
* scroll-region (DECSTBM) + CSI S/T handling deviates from xterm and, when
|
|
245
|
+
* driven per-frame by a diffing renderer, corrupts the screen progressively
|
|
246
|
+
* as content scrolls (the "JetBrains terminal slowly garbles" bug class).
|
|
247
|
+
* The diff engine falls back to repainting the shifted rows cell-by-cell,
|
|
248
|
+
* which every terminal renders identically. Same gate as upstream Claude
|
|
249
|
+
* Code, which hard-disables DECSTBM on JetBrains terminals.
|
|
250
|
+
* @returns true when DECSTBM scroll optimization is safe on this terminal.
|
|
251
|
+
*/
|
|
252
|
+
export function isDecstbmSafe() {
|
|
253
|
+
return SYNC_OUTPUT_SUPPORTED && !isJetBrainsIdeTerminal();
|
|
254
|
+
}
|
|
203
255
|
/**
|
|
204
256
|
* Render forensics: when DSH_TUI_RENDER_LOG names a file path, every painted
|
|
205
257
|
* frame's raw ANSI bytes append to it (one JSON-escaped line per frame,
|
|
@@ -31,6 +31,12 @@ type TokenizerOptions = {
|
|
|
31
31
|
* output streams, and enabling this there swallows display text. Default false.
|
|
32
32
|
*/
|
|
33
33
|
x10Mouse?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Emit standalone C0/DEL input controls as sequence tokens instead of
|
|
36
|
+
* merging them with adjacent text. Intended for stdin key parsing; output
|
|
37
|
+
* parsers leave this disabled so controls such as BEL and Tab remain text.
|
|
38
|
+
*/
|
|
39
|
+
splitInputControls?: boolean;
|
|
34
40
|
};
|
|
35
41
|
/**
|
|
36
42
|
* Create a streaming tokenizer for terminal input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenize.d.ts","sourceRoot":"","sources":["../../../../src/ink/termio/tokenize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,sEAAsE;AACtE,MAAM,MAAM,KAAK,GACb;IAAE,IAAI,EAAE,MAAM,CAAC;IAA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AC,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS,CA4CrE"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Unlike the Parser which interprets sequences semantically, this just
|
|
6
6
|
* identifies boundaries for use by keyboard input parsing.
|
|
7
7
|
*/
|
|
8
|
-
import { C0, ESC_TYPE, isEscFinal } from './ansi.js';
|
|
8
|
+
import { C0, ESC_TYPE, isC0, isEscFinal } from './ansi.js';
|
|
9
9
|
import { isCSIFinal, isCSIIntermediate, isCSIParam } from './csi.js';
|
|
10
10
|
/**
|
|
11
11
|
* Create a streaming tokenizer for terminal input.
|
|
@@ -24,15 +24,16 @@ export function createTokenizer(options) {
|
|
|
24
24
|
let currentState = 'ground';
|
|
25
25
|
let currentBuffer = '';
|
|
26
26
|
const x10Mouse = options?.x10Mouse ?? false;
|
|
27
|
+
const splitInputControls = options?.splitInputControls ?? false;
|
|
27
28
|
return {
|
|
28
29
|
feed(input) {
|
|
29
|
-
const result = tokenize(input, currentState, currentBuffer, false, x10Mouse);
|
|
30
|
+
const result = tokenize(input, currentState, currentBuffer, false, x10Mouse, splitInputControls);
|
|
30
31
|
currentState = result.state.state;
|
|
31
32
|
currentBuffer = result.state.buffer;
|
|
32
33
|
return result.tokens;
|
|
33
34
|
},
|
|
34
35
|
flush() {
|
|
35
|
-
const result = tokenize('', currentState, currentBuffer, true, x10Mouse);
|
|
36
|
+
const result = tokenize('', currentState, currentBuffer, true, x10Mouse, splitInputControls);
|
|
36
37
|
currentState = result.state.state;
|
|
37
38
|
currentBuffer = result.state.buffer;
|
|
38
39
|
return result.tokens;
|
|
@@ -46,7 +47,7 @@ export function createTokenizer(options) {
|
|
|
46
47
|
},
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
|
-
function tokenize(input, initialState, initialBuffer, flush, x10Mouse) {
|
|
50
|
+
function tokenize(input, initialState, initialBuffer, flush, x10Mouse, splitInputControls) {
|
|
50
51
|
const tokens = [];
|
|
51
52
|
const result = {
|
|
52
53
|
state: initialState,
|
|
@@ -82,6 +83,19 @@ function tokenize(input, initialState, initialBuffer, flush, x10Mouse) {
|
|
|
82
83
|
result.state = 'escape';
|
|
83
84
|
i++;
|
|
84
85
|
}
|
|
86
|
+
else if (splitInputControls &&
|
|
87
|
+
isC0(code) &&
|
|
88
|
+
code !== C0.CR &&
|
|
89
|
+
code !== C0.LF) {
|
|
90
|
+
// stdin.read() can coalesce printable text and interactive control
|
|
91
|
+
// keys into one chunk. Keep Backspace, Tab, Ctrl+C, etc. as their
|
|
92
|
+
// own tokens so parseKeypress can expose the corresponding key
|
|
93
|
+
// flags instead of leaking the control byte into prompt text.
|
|
94
|
+
// CR/LF stay in text chunks for the Windows piped-line fallback.
|
|
95
|
+
flushText();
|
|
96
|
+
i++;
|
|
97
|
+
emitSequence(data.slice(i - 1, i));
|
|
98
|
+
}
|
|
85
99
|
else {
|
|
86
100
|
i++;
|
|
87
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/screens/Chat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,EAAqB,KAAK,OAAO,EAAsD,MAAM,2BAA2B,CAAA;AAC/H,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AA0H3D,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,aAAa,EACb,aAAa,EACb,MAAM,EACN,QAAQ,EACR,UAAkB,EAClB,cAAc,EAAE,kBAAkB,GACnC,EAAE;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,aAAa,CAAA;IAC5B;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB;;;;;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