Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/vscode-terminal-progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Enable terminal progress reporting in VS Code integrated terminals.
4 changes: 3 additions & 1 deletion apps/kimi-code/src/tui/utils/terminal-notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ export function supportsTerminalProgress(env: NodeJS.ProcessEnv = process.env):
if ((env['WT_SESSION'] ?? '').length > 0) return true;
if (env['ConEmuANSI'] === 'ON') return true;
const termProgram = env['TERM_PROGRAM'] ?? '';
if (termProgram === 'ghostty' || termProgram === 'WezTerm') return true;
if (termProgram === 'ghostty' || termProgram === 'WezTerm' || termProgram === 'vscode') {
return true;
}
const term = env['TERM'] ?? '';
if (term === 'xterm-ghostty') return true;
return false;
Expand Down
4 changes: 4 additions & 0 deletions apps/kimi-code/test/tui/terminal-notification.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ describe('supportsTerminalProgress', () => {
expect(supportsTerminalProgress({ ConEmuANSI: 'ON' })).toBe(true);
});

it('detects the VS Code integrated terminal via TERM_PROGRAM', () => {
expect(supportsTerminalProgress({ TERM_PROGRAM: 'vscode' })).toBe(true);
});

it('detects Ghostty / WezTerm via TERM_PROGRAM and TERM', () => {
expect(supportsTerminalProgress({ TERM_PROGRAM: 'ghostty' })).toBe(true);
expect(supportsTerminalProgress({ TERM: 'xterm-ghostty' })).toBe(true);
Expand Down
8 changes: 8 additions & 0 deletions docs/en/guides/interaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ The input box remains usable while the agent is thinking or calling tools, and s
- **`Esc` / `Ctrl-C`**: interrupt the current turn
- **`Ctrl-O`**: globally toggle the collapsed/expanded state of tool output and compaction summaries

VS Code 1.97 or later can show Kimi Code CLI's working-state indicator in integrated terminal tabs. Include `${progress}` in [`terminal.integrated.tabs.title` or `terminal.integrated.tabs.description`](https://code.visualstudio.com/docs/terminal/appearance#_tab-text), for example:

```json
{
"terminal.integrated.tabs.title": "${process}${separator}${progress}"
}
```

## External editor

Press `Ctrl-G` to send the current input content to an external editor. When you save and close, the text is written back into the input box; if you close without saving, the original content is preserved. This is handy when you need to enter large blocks of text or content with complex formatting.
Expand Down
8 changes: 8 additions & 0 deletions docs/zh/guides/interaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ Agent 思考或调用工具时,输入框仍然可用,支持以下额外操
- **`Esc` / `Ctrl-C`**:中断当前轮次
- **`Ctrl-O`**:全局切换工具输出和压缩摘要的折叠状态

VS Code 1.97 及更高版本可以在集成终端的标签页中显示 Kimi Code CLI 的工作状态指示器。请在 [`terminal.integrated.tabs.title` 或 `terminal.integrated.tabs.description`](https://code.visualstudio.com/docs/terminal/appearance#_tab-text) 中包含 `${progress}`,例如:

```json
{
"terminal.integrated.tabs.title": "${process}${separator}${progress}"
}
```

## 外部编辑器

按 `Ctrl-G` 把当前输入内容发给外部编辑器,保存后回填到输入框,不保存则保持原样。适合需要输入大段文本或带格式内容的场景。
Expand Down