MoonshotAI / MoonshotAI/kimi-code

WSL + Windows Terminal 下 OSC 9;4 进度序列会阻止自动隐藏任务栏唤起

Open
#727 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

What version of Kimi Code is running?

kimi --version: 0.14.2

Which open platform/subscription were you using?

不依赖具体平台或订阅。这个问题发生在 TUI 等待/接收响应期间,和账号订阅无关。

Which model were you using?

不依赖具体模型。发送任意会让 TUI 进入等待响应状态的消息即可复现。

What platform is your computer?
  • Windows 11 x64: Microsoft Windows [Version 10.0.26100.4652]
  • WSL2: Ubuntu 24.04.3 LTS
  • Kernel: Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64
  • Windows Terminal: Microsoft.WindowsTerminal package path indicates 1.24.11321.0
  • Relevant environment variables inside WSL:
    • WT_SESSION is set
    • WSL_DISTRO_NAME=Ubuntu
    • WSL_INTEROP is set
    • TERM=xterm-256color
What issue are you seeing?

在 WSL + Windows Terminal 中运行 Kimi Code TUI 时,如果 Windows 任务栏处于自动隐藏状态,发送消息并等待模型响应期间,把鼠标移动到屏幕最下边无法正确唤起 Windows 任务栏。

响应一结束,任务栏立刻可以正常唤起。这个现象可以稳定复现。

我确认这个问题和 Kimi Code 在等待响应期间发送的 terminal progress 序列有关:屏蔽 WT_SESSION 后启动 Kimi Code,任务栏自动隐藏行为马上恢复正常:

WT_SESSION= command kimi
What steps can reproduce the bug?
  1. 在 Windows 11 中开启任务栏自动隐藏。
  2. 使用 Windows Terminal 打开 WSL2 Ubuntu。
  3. 在 WSL 中正常运行 kimi,确保环境里存在 WT_SESSION
  4. 在 Kimi Code TUI 中发送一条消息,让 TUI 进入等待/响应状态。
  5. 响应过程中,把鼠标移动到屏幕最下边尝试唤起自动隐藏的 Windows 任务栏。
  6. 观察到任务栏无法正常唤起。
  7. 等 Kimi Code 响应结束后,再次移动鼠标到屏幕最下边,任务栏可以正常唤起。
  8. WT_SESSION= command kimi 启动后重复上述步骤,问题消失。

也可以用最小 OSC 序列验证这个方向:

printf '\033]9;4;3\a'
sleep 15
printf '\033]9;4;0;\a'

Kimi Code 的时序和这个序列一致:响应开始时启用 indeterminate progress,响应结束时清除 progress。

What is the expected behavior?

Kimi Code 在等待/接收响应期间不应该影响 Windows 自动隐藏任务栏的唤起。即使 TUI 正在等待模型响应,用户也应该能把鼠标移动到屏幕边缘并正常唤出任务栏。

Additional information

初步定位到的原因是 Kimi Code 把 WT_SESSION 视为支持 OSC 9;4 terminal progress 的信号。进入等待/思考/工具执行状态时,TUI 会调用 terminal progress;底层 pi-tui 会发送 OSC 9;4;3 并每秒 keepalive,结束时发送 OSC 9;4;0 清除。

这个机制在 WSL + Windows Terminal 下会反映到 Windows 任务栏进度状态,并且会干扰 Windows 任务栏自动隐藏的边缘唤起行为。

可能的修复方向:

  • 在 WSL + Windows Terminal 环境下不要默认启用 OSC 9;4 terminal progress。
  • 或者提供 TUI 配置项允许关闭 terminal progress,例如:
[terminal]
progress = false

更完整的配置语义也可以是 auto / on / off,由 auto 避开已知会影响任务栏行为的环境。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TUI terminal-progress handling and its pi-tui integration, then reproduce the behavior in WSL with WT_SESSION set. Compare the normal command with WT_SESSION= command kimi and the minimal OSC 9;4 sequence. Done means waiting for a response no longer prevents Windows Terminal's auto-hidden taskbar from appearing, while progress behavior remains correct elsewhere.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
54/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.