Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Native SWT keyboard behavior needs Windows/Linux and AltGr-layout validation because helper tests do not cover Shift+Tab traversal or characters delivered for Ctrl+Alt chords.
No open issues 🎉
What changed in this PR
Aligns Eclipse Terminal’s keyboard handling with xterm so terminal applications receive expected key sequences while preserving AltGr input and shell-prompt shortcuts.
Changes:
- Adds Shift+Tab handling, modified Delete sequences, Ctrl+digit mappings, and ESC prefixes for control-character Ctrl+Alt combinations.
- Routes modified arrows to terminal applications on the alternate screen, even when Eclipse has matching bindings.
- Adds tests for character mappings, AltGr handling, modified Delete, and alternate-screen state.
| File | Description |
|---|---|
| terminal/tests/org.eclipse.terminal.test/src/org/eclipse/terminal/internal/emulator/VT100EmulatorTest.java | Tests key mappings, Alt handling, and alternate-screen reporting. |
| terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/emulator/VT100TerminalControl.java | Updates key encoding, Shift+Tab focus handling, and alternate-screen arrow routing. |
| terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/emulator/VT100Emulator.java | Exposes alternate-screen state and makes it visible across threads. |
Review effort: Balanced
…rm does Keys that Claude Code, Codex and other terminal programs use, checked key by key against xterm: - Shift+Tab sends back tab (CSI Z), as xterm and Windows Terminal do, and no longer moves the focus out of the terminal; Claude Code switches modes with it. - Ctrl, Shift and Alt with Delete carry the modifier (CSI 3 ; 5 ~ and so on); every Delete used to arrive as a plain Delete. - A real Ctrl+Alt on a letter keeps its Alt: ESC before the control character, as in xterm (Ctrl+Alt+V pastes an image in Codex on WSL). AltGr, which SWT reports as Ctrl+Alt with the character it types, types that character as before, and Backspace, Enter, Tab and Esc with AltGr still held send what they did. Ctrl+Alt with a digit or Space is left as it was, since on Windows it cannot be told from AltGr: xterm's ESC with the control character would turn AltGr+Space into ESC NUL. - Ctrl+2 to Ctrl+8 send NUL, ESC, FS, GS, RS, US and DEL; on Windows they sent the digits. - On the alternate screen Alt and Ctrl with the arrows go to the full screen program even where Eclipse has a binding for them (Alt+Up edits a queued message in Codex); at the shell prompt Alt+Up still maximizes the view.
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.
Keys that Claude Code, Codex and other terminal programs use, checked key by key against xterm:
How to test, in a bash terminal: run
od -c, press the key, then Enter, and Ctrl+D to end.Tests: new cases in VT100EmulatorTest for Ctrl with the digits, Alt with ESC (AltGr included), Delete with modifiers and the alternate screen flag.