fix(terminal): support Shift+Tab and Shift+Enter on Windows for CLI tools#1560
Open
wuaman wants to merge 1 commit into
Open
fix(terminal): support Shift+Tab and Shift+Enter on Windows for CLI tools#1560wuaman wants to merge 1 commit into
wuaman wants to merge 1 commit into
Conversation
Map Shift+Tab to CBT (ESC [ Z) and Shift+Enter to CSI-u modified Enter (ESC [ 13;2u) for better shell and TUI compatibility.
This was referenced Jun 29, 2026
Contributor
|
该代码在所有操作系统上生效,macOS 和 Linux 是否会有问题呢?这两个快捷键需要限定在 Windows 系统上吗? |
Author
|
关于修改该代码在macOS 和 Linux上是否会产生问题,我没有测试过。我主要在Windows上使用,所以打包后也只在Windows上进行了测试。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes missing Shift+Tab and Shift+Enter key mappings on Windows, which prevented these shortcuts from working in interactive CLI tools such as Claude Code.
Previously, Termora did not encode these modifier combinations into the escape sequences that TUI/CLI applications expect. As a result:
This change adds explicit mappings in
KeyEncoderImpl:ESC [ ZESC [ 13;2uProblem
On Windows, when using Termora with interactive CLI tools (e.g. Claude Code):
These tools rely on specific terminal escape sequences for modified keys. Without proper encoding, the key events were not delivered correctly to the running process.
Solution
Add missing key bindings in
KeyEncoderImpl.ktso that Shift+Tab and Shift+Enter are translated into the standard sequences expected by modern shell and TUI applications.Test plan