GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — docs: document the Windows Terminal ctrl+tab caveat by Kissshot-2003 · Pull Request #57674 · anomalyco/opencode Conversation
|
| encoding | ctrl+tab |
ctrl+shift+tab |
tab |
|---|---|---|---|
| default, no unbind | (nothing) | (nothing) | 0x09 |
ctrl+tab unbound, legacy |
0x09 |
ESC [ Z |
0x09 |
ctrl+tab unbound, kitty requested |
0x09 |
ESC [ Z |
0x09 |
ctrl+tab unbound, win32-input-mode |
CSI 9 ; 15 ; 0 ; 1 ; 40 ; 1 _ |
CSI 9 ; 15 ; 0 ; 1 ; 56 ; 1 _ |
CSI 9 ; 1 ; 9 ; 1 ; 32 ; 1 _ |
Three things fall out of that:
ctrl+tab is the same byte as tab and ctrl+shift+tab is a plain shift+tab. The Ctrl is gone either way.win32-input-mode, and the win32-input-mode row is the one where the key-down arrives at all.alt+down and alt+up are not reserved by the terminal and do arrive: they come through as CSI 1 ; 3 B and CSI 1 ; 3 A, which the parser reads as down and up with the alt modifier.
This PR adds a ### Windows Terminal subsection under ## Sessions in services/www/src/docs/content/cli/keybinds.mdx, next to the table that lists the session tab bindings. It says that the terminal reserves ctrl+tab and ctrl+shift+tab, points at alt+down and alt+up as the ones that work, and explains that unbinding the terminal's binding only helps once win32-input-mode is on.
{ "command": "unbound", "keys": "ctrl+tab" } to the actions array of the terminal's settings.json, took a byte-exact backup first, and restored the file afterwards.alt+down and alt+up (CSI 1 ; 3 B and CSI 1 ; 3 A) through the TUI's key parser and confirmed they resolve to down and up with the alt modifier set, so the alternative the new subsection points at is one that actually works.settings.json shape against the Windows Terminal documentation: keybindings was replaced by actions in version 1.4, and "unbound" is the value that releases a default binding.bun typecheck and bun run check:generated from services/www: 0 errors, 0 warnings and 0 hints over the 34 Astro files, and the generated-output check passes.bun run build from services/www.Not a UI change.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The following comment was made by an LLM, it may be inaccurate: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The doc is right about why ctrl+tab/ctrl+shift+tab fail on Windows Terminal and about alt+down/alt+up. I checked the defaults in packages/tui/src/config/keybind.ts and how the TUI sets up the keyboard in packages/tui/src/app.tsx. Nothing to run, since only docs change. Public API is unchanged.
One concern: the second workaround (unbinding the keys in Windows Terminal's settings.json) probably doesn't work today. See the inline comment.
Related: #55606
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| ### Windows Terminal | ||
|
|
||
| Windows Terminal binds `ctrl+tab` and `ctrl+shift+tab` to its own tab actions, so those keys never reach OpenCode. Use `alt+down` and `alt+up` to switch session tabs instead, or unbind the terminal's action in `settings.json`: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't think the unbind workaround works yet. The TUI only asks for the kitty keyboard protocol (useKittyKeyboard in packages/tui/src/app.tsx) and never asks for win32-input-mode. As your measurements in #55606 show, Windows Terminal ignores the kitty request, so after unbinding, OpenCode still gets the legacy encoding. In that encoding ctrl+tab looks the same as Tab, and ctrl+shift+tab sends no bytes at all. So unbinding probably won't switch session tabs, and ctrl+tab may trigger Tab autocomplete instead. Unless you've tested that unbinding works with the current TUI, I'd drop the settings.json snippet and keep only the alt+down/alt+up advice. Another option is to say the unbind only helps once win32-input-mode is supported (anomalyco/opentui#1726 plus requesting the mode).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
My earlier point about the settings.json unbind workaround is fixed: the snippet is gone, and the section now says unbinding isn't enough while win32-input-mode is off, which matches what the TUI asks the terminal for. Nothing else to raise. Docs-only change; public API is unchanged.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Windows Terminal binds ctrl+tab and ctrl+shift+tab to its own tab actions, so the key-down never reaches the client application. The session tab bindings list ctrl+tab first, and it silently fails on the default Windows Terminal. Measured on Windows Terminal 1.24.12741, a key with no terminal binding arrives as a full press and release pair, while ctrl+shift+tab arrives as a release only. alt+down and alt+up are not reserved by the terminal and arrive as CSI 1 ; 3 B and CSI 1 ; 3 A. The new subsection sits next to the table that lists the session tab bindings, points at alt+down and alt+up, and gives the settings.json snippet that unbinds the terminal's action. Refs anomalyco#55606
Unbinding ctrl+tab does not help yet: the TUI only requests the kitty keyboard protocol, which Windows Terminal ignores, and it never turns on win32-input-mode. After unbinding, the terminal still sends the legacy encoding, where ctrl+tab is a plain tab and ctrl+shift+tab sends nothing. Keep the alt+down / alt+up advice, which does work, and state why unbinding does not.
c799398 to
00a55f2
Compare
|
Rebased onto The conflict was in One thing worth knowing: the required checks on |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Superseded by the docs-tree move: #63117 removed The Windows Terminal ctrl+tab caveat is still absent from the new |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.