Skip to content

fix: handle physical keyboard special keys in terminal#6

Merged
LukeGus merged 4 commits intoTermix-SSH:dev-1.3.0from
ZacharyZcR:fix/physical-tab-key
Feb 14, 2026
Merged

fix: handle physical keyboard special keys in terminal#6
LukeGus merged 4 commits intoTermix-SSH:dev-1.3.0from
ZacharyZcR:fix/physical-tab-key

Conversation

@ZacharyZcR
Copy link
Copy Markdown
Member

@ZacharyZcR ZacharyZcR commented Feb 12, 2026

Summary

  • Physical keyboard Tab, Escape, and arrow keys were silently dropped by the key.length === 1 filter in onKeyPress
  • These named keys (e.g. "Tab", "Escape", "ArrowUp") have length > 1 and were not explicitly handled like Enter/Backspace
  • Add explicit handlers: Tab → \t, Escape → \x1b, arrows → standard escape sequences
  • Add iOS native UIKeyCommand module to intercept Shift+Tab on hardware keyboards and forward \x1b[Z (backtab) to the terminal

iOS Native Module (modules/hardware-keyboard)

  • Expo native module using UIKeyCommand with wantsPriorityOverSystemBehavior to capture Shift+Tab before the system handles it
  • Method swizzling on UIViewController.keyCommands to inject the key command globally
  • Events bridge to JS via Expo's EventEmitter pattern

Test plan

  • Connect a physical keyboard to iOS device/simulator
  • Open a terminal session (e.g. with claude CLI)
  • Press Tab → sends \t (tab completion)
  • Press Shift+Tab → sends \x1b[Z (backtab / reverse tab)
  • Press Escape → sends \x1b
  • Press arrow keys → cursor navigation works

Relates to Termix-SSH/Support#355

winmin and others added 3 commits January 24, 2026 18:43
Tab, Escape, and arrow keys from physical keyboards were filtered out
by the key.length === 1 check. Add explicit handling like Enter/Backspace.
Add Expo native module that uses UIKeyCommand + method swizzling
to intercept Shift+Tab on iOS hardware keyboards and forward
the backtab escape sequence (\x1b[Z]) to the active terminal.
@LukeGus LukeGus changed the base branch from main to dev-1.3.0 February 14, 2026 21:58
@LukeGus LukeGus merged commit 43c8bec into Termix-SSH:dev-1.3.0 Feb 14, 2026
LukeGus added a commit that referenced this pull request Feb 19, 2026
* fix: ipad keyboard issue + paste key not wokring and disabled auto correct

* fix: ipad keyboard issues

* fix: ipad styling issues, emoji/voice dictation support, android keyboard issues

* fix: ipad styling issues

* feat: add debuging to fix ipad keyboard margins

* fix: handle physical keyboard special keys in terminal (#6)

* feat: add iPadOS build workflow without EAS dependency (#4)

* fix: handle physical keyboard special keys in terminal

Tab, Escape, and arrow keys from physical keyboards were filtered out
by the key.length === 1 check. Add explicit handling like Enter/Backspace.

* feat: add iOS native Shift+Tab support via UIKeyCommand

Add Expo native module that uses UIKeyCommand + method swizzling
to intercept Shift+Tab on iOS hardware keyboards and forward
the backtab escape sequence (\x1b[Z]) to the active terminal.

---------

Co-authored-by: swing <bestswngs@gmail.com>
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>

* feat: improve ipad ui logic and improve external keyboard handling

* feat: fix arrow keys and modifier keys on hardware keybords

* fix: fix arrow keys and modifier keys on hardware keybords

* feat: add voice over support and improved terminal background conneciton

* feat: add missing files

* feat: add host key verification support

* fix: dictation issues + android IME multi character input issues on android

* fix: none auth hosts

* chore: clean

* chore: update readme

---------

Co-authored-by: ZacharyZcR <zacharyzcr1984@gmail.com>
Co-authored-by: swing <bestswngs@gmail.com>
LukeGus added a commit that referenced this pull request Mar 3, 2026
* fix: ipad keyboard issue + paste key not wokring and disabled auto correct

* fix: ipad keyboard issues

* fix: ipad styling issues, emoji/voice dictation support, android keyboard issues

* fix: ipad styling issues

* feat: add debuging to fix ipad keyboard margins

* fix: handle physical keyboard special keys in terminal (#6)

* feat: add iPadOS build workflow without EAS dependency (#4)

* fix: handle physical keyboard special keys in terminal

Tab, Escape, and arrow keys from physical keyboards were filtered out
by the key.length === 1 check. Add explicit handling like Enter/Backspace.

* feat: add iOS native Shift+Tab support via UIKeyCommand

Add Expo native module that uses UIKeyCommand + method swizzling
to intercept Shift+Tab on iOS hardware keyboards and forward
the backtab escape sequence (\x1b[Z]) to the active terminal.

---------

Co-authored-by: swing <bestswngs@gmail.com>
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>

* feat: improve ipad ui logic and improve external keyboard handling

* feat: fix arrow keys and modifier keys on hardware keybords

* fix: fix arrow keys and modifier keys on hardware keybords

* feat: add voice over support and improved terminal background conneciton

* feat: add missing files

* feat: add host key verification support

* fix: dictation issues + android IME multi character input issues on android

* fix: none auth hosts

* chore: clean

* chore: update readme

* feat: add SSH session persistence for background/foreground transitions

Adapt the mobile client to the server-side session persistence protocol
(Termix PR #594). When the app goes to background and the WebSocket dies,
the server keeps the SSH session alive. On foreground return, the client
sends attachSession instead of connectToHost, reattaching to the existing
session with buffered output replay.

- Track server sessionId from sessionCreated messages
- Send attachSession on reconnect when a sessionId exists
- Handle sessionExpired with automatic fallback to fresh connectToHost
- Handle sessionTakenOver for multi-device scenarios
- Send explicit disconnect on destroy to clean up server sessions
- Skip terminal clear and post-connection setup on reattach

---------

Co-authored-by: LukeGus <bugattiguy527@gmail.com>
Co-authored-by: swing <bestswngs@gmail.com>
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>
LukeGus added a commit that referenced this pull request Mar 9, 2026
* feat: SSH session persistence across app background/foreground (#8)

* fix: ipad keyboard issue + paste key not wokring and disabled auto correct

* fix: ipad keyboard issues

* fix: ipad styling issues, emoji/voice dictation support, android keyboard issues

* fix: ipad styling issues

* feat: add debuging to fix ipad keyboard margins

* fix: handle physical keyboard special keys in terminal (#6)

* feat: add iPadOS build workflow without EAS dependency (#4)

* fix: handle physical keyboard special keys in terminal

Tab, Escape, and arrow keys from physical keyboards were filtered out
by the key.length === 1 check. Add explicit handling like Enter/Backspace.

* feat: add iOS native Shift+Tab support via UIKeyCommand

Add Expo native module that uses UIKeyCommand + method swizzling
to intercept Shift+Tab on iOS hardware keyboards and forward
the backtab escape sequence (\x1b[Z]) to the active terminal.

---------

Co-authored-by: swing <bestswngs@gmail.com>
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>

* feat: improve ipad ui logic and improve external keyboard handling

* feat: fix arrow keys and modifier keys on hardware keybords

* fix: fix arrow keys and modifier keys on hardware keybords

* feat: add voice over support and improved terminal background conneciton

* feat: add missing files

* feat: add host key verification support

* fix: dictation issues + android IME multi character input issues on android

* fix: none auth hosts

* chore: clean

* chore: update readme

* feat: add SSH session persistence for background/foreground transitions

Adapt the mobile client to the server-side session persistence protocol
(Termix PR #594). When the app goes to background and the WebSocket dies,
the server keeps the SSH session alive. On foreground return, the client
sends attachSession instead of connectToHost, reattaching to the existing
session with buffered output replay.

- Track server sessionId from sessionCreated messages
- Send attachSession on reconnect when a sessionId exists
- Handle sessionExpired with automatic fallback to fresh connectToHost
- Handle sessionTakenOver for multi-device scenarios
- Send explicit disconnect on destroy to clean up server sessions
- Skip terminal clear and post-connection setup on reattach

---------

Co-authored-by: LukeGus <bugattiguy527@gmail.com>
Co-authored-by: swing <bestswngs@gmail.com>
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>

* fix: clear terminal after reconnecting and fix letter duplcation

* chore: increment ver

---------

Co-authored-by: ZacharyZcR <PayasoNorahC@protonmail.com>
Co-authored-by: swing <bestswngs@gmail.com>
LukeGus added a commit that referenced this pull request Mar 15, 2026
* feat: SSH session persistence across app background/foreground (#8)

* fix: ipad keyboard issue + paste key not wokring and disabled auto correct

* fix: ipad keyboard issues

* fix: ipad styling issues, emoji/voice dictation support, android keyboard issues

* fix: ipad styling issues

* feat: add debuging to fix ipad keyboard margins

* fix: handle physical keyboard special keys in terminal (#6)

* feat: add iPadOS build workflow without EAS dependency (#4)

* fix: handle physical keyboard special keys in terminal

Tab, Escape, and arrow keys from physical keyboards were filtered out
by the key.length === 1 check. Add explicit handling like Enter/Backspace.

* feat: add iOS native Shift+Tab support via UIKeyCommand

Add Expo native module that uses UIKeyCommand + method swizzling
to intercept Shift+Tab on iOS hardware keyboards and forward
the backtab escape sequence (\x1b[Z]) to the active terminal.

---------

Co-authored-by: swing <bestswngs@gmail.com>
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>

* feat: improve ipad ui logic and improve external keyboard handling

* feat: fix arrow keys and modifier keys on hardware keybords

* fix: fix arrow keys and modifier keys on hardware keybords

* feat: add voice over support and improved terminal background conneciton

* feat: add missing files

* feat: add host key verification support

* fix: dictation issues + android IME multi character input issues on android

* fix: none auth hosts

* chore: clean

* chore: update readme

* feat: add SSH session persistence for background/foreground transitions

Adapt the mobile client to the server-side session persistence protocol
(Termix PR #594). When the app goes to background and the WebSocket dies,
the server keeps the SSH session alive. On foreground return, the client
sends attachSession instead of connectToHost, reattaching to the existing
session with buffered output replay.

- Track server sessionId from sessionCreated messages
- Send attachSession on reconnect when a sessionId exists
- Handle sessionExpired with automatic fallback to fresh connectToHost
- Handle sessionTakenOver for multi-device scenarios
- Send explicit disconnect on destroy to clean up server sessions
- Skip terminal clear and post-connection setup on reattach

---------

Co-authored-by: LukeGus <bugattiguy527@gmail.com>
Co-authored-by: swing <bestswngs@gmail.com>
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>

* fix: clear terminal after reconnecting and fix letter duplcation

* chore: increment ver

* fix: use new 2.0.0 api routes and filter non ssh hosts

* chore: increment ver

---------

Co-authored-by: ZacharyZcR <PayasoNorahC@protonmail.com>
Co-authored-by: swing <bestswngs@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants