Skip to content

shift tab切换模式不生效 #2

Description

@sumumh

进入plan模式后按下shift tab,未能切换到其他模式

Activity

  1. sumumm commented on Jul 5, 2026

    @sumumm
    Contributor

    已定位并修复。

    根因

    Windows 平台下 Shift+Tab 能否被正确识别,取决于 Node.js 是否启用了 VT(Virtual Terminal)模式:

    • 启用 VT 模式时,终端为 Shift+Tab 发送 \x1b[Z,可区分修饰键
    • 未启用时,Shift+Tab 退化为普通 \t,与 Tab 无法区分

    Node.js 自 22.17.0 / 24.2.0 起默认启用 VT 模式(tty: use terminal VT mode on Windows #58358)。低于此版本的 Node 在 Windows 下会遇到此问题(macOS/Linux 不受影响)。

    注:这不是 smink 或 smcode 的解析 bug——按键解析链路正确,是终端在 OS 层就没把 shift 修饰信息发出来。

    解决方案

    两种方式任选其一:

    方案 1(推荐):升级 Node 到 22.17.0+ 或 24.2.0+,VT 模式自动启用,Shift+Tab 立即恢复正常。

    方案 2:已在 bd0e98f 加入了自动回退机制(对齐 Claude Code 的做法)——旧版 Node 的 Windows 环境下,模式切换键会自动回退为 Alt+M,底部 ModeIndicator 也会同步显示真实切换键,不会再卡住无法切换。

    参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions