Skip to content

Make Tab key configurable via next_screen/next_tab keybindings#10

Open
vsnote wants to merge 1 commit intotimhartmann7:mainfrom
vsnote:fix/make-tab-key-configurable
Open

Make Tab key configurable via next_screen/next_tab keybindings#10
vsnote wants to merge 1 commit intotimhartmann7:mainfrom
vsnote:fix/make-tab-key-configurable

Conversation

@vsnote
Copy link
Copy Markdown

@vsnote vsnote commented Apr 29, 2026

Summary

Previously the Tab key was hardcoded for screen cycling (non-Terminal screens) and tab switching (Terminal screen). This prevented Tab from being forwarded to the remote shell for command completion — a significant pain point when working inside SSH sessions.

Changes

  1. New keybinding fields — Added next_screen and next_tab to KeybindingsConfig, both defaulting to "Tab" for backward compatibility.

  2. KeyBind struct — Added support for "Ctrl+<char>" format in config (e.g. "Ctrl+T", "Ctrl+W") via the new parse_keybind function and KeyBind struct with .matches(key) method.

  3. Terminal handler — Replaced the hardcoded KeyCode::Tab check in handle_terminal_key with self.view.keybindings.next_tab.matches(key).

  4. Screen cycling — Replaced KeyCode::Tab in handle_key's match block with self.view.keybindings.next_screen.matches(key).

  5. Moved host picker — Changed TermOpenHostPicker shortcut from Ctrl+T to Ctrl+N (more intuitive: "New tab"). Updated all UI hints and help popup text accordingly. This frees Ctrl+T for users who want to bind tab switching to it.

Usage

Users who want to free Tab for shell completion can set in ~/.config/omnyssh/config.toml:

[keybindings]
next_screen = "Ctrl+T"
next_tab = "Ctrl+T"

Default behavior is unchanged — existing users are not affected.

Test plan

  • All 82 existing tests pass
  • 2 new tests added for parse_keybind (Ctrl+ combo parsing and plain key parsing)
  • Compiles with zero warnings

Previously the Tab key was hardcoded for screen cycling (non-Terminal)
and tab switching (Terminal). This prevented Tab from being forwarded
to the remote shell for command completion — a frequent pain point
when working inside SSH sessions.

Changes:
- Add next_screen and next_tab fields to KeybindingsConfig, defaulting
  to "Tab" for backward compatibility
- Add KeyBind struct supporting "Ctrl+<char>" format in config
- Replace hardcoded KeyCode::Tab with config-driven checks in both
  handle_key and handle_terminal_key
- Move TermOpenHostPicker shortcut from Ctrl+T to Ctrl+N to avoid
  conflict when users bind next_tab to Ctrl+T
- Update UI hints and help popup to reflect Ctrl+N for new tabs

Users can now set e.g. next_tab = "Ctrl+T" in ~/.config/omnyssh/config.toml
to free Tab for shell completion.
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.

1 participant