Skip to content

Commit 705a700

Browse files
committed
Change primary help key to Ctrl+h (with F1 and Ctrl+? fallbacks)
- Ctrl+h is more mnemonic (h = help) and easier to type - F1 and Ctrl+? still work as alternatives - Updated status bar to show 'Ctrl+h help' - Tested successfully in tmux with all three key combinations - Updated documentation to reflect Ctrl+h as primary Assisted-By: docker-agent
1 parent 56bdcfc commit 705a700

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

docs/HELP_DIALOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The cagent TUI now includes a contextual help dialog that displays all currently
66

77
## Usage
88

9-
Press **F1** to open the help dialog. (Alternatively, **Ctrl+?** also works in terminals that support keyboard enhancements.)
9+
Press **Ctrl+h** to open the help dialog. (Alternatively, **F1** or **Ctrl+?** also work.)
1010

1111
The dialog will show all key bindings that are currently active based on:
1212
- Which panel is focused (content view vs editor)
@@ -63,7 +63,12 @@ The help dialog will pick this up automatically when it's included in any `Bindi
6363

6464
## Key Binding Notes
6565

66-
**F1** is used as the primary help key because it's universally supported across all terminals. **Ctrl+?** (Ctrl+Shift+/) is also supported as an alternative, but requires terminals with keyboard enhancement support (kitty protocol).
66+
**Ctrl+h** is used as the primary help key because:
67+
- It's mnemonic (h = help)
68+
- It's universally supported across all terminals
69+
- It's easy to remember and type
70+
71+
**F1** and **Ctrl+?** are also supported as alternatives. Ctrl+? requires terminals with keyboard enhancement support (kitty protocol).
6772

6873
## Related Files
6974

pkg/tui/tui.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,8 +1578,8 @@ func (m *appModel) Bindings() []key.Binding {
15781578
))
15791579

15801580
bindings = append(bindings, key.NewBinding(
1581-
key.WithKeys("f1"),
1582-
key.WithHelp("F1", "help"),
1581+
key.WithKeys("ctrl+h"),
1582+
key.WithHelp("Ctrl+h", "help"),
15831583
))
15841584

15851585
// Show newline help based on keyboard enhancement support
@@ -1693,7 +1693,7 @@ func (m *appModel) handleKeyPress(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) {
16931693
case key.Matches(msg, key.NewBinding(key.WithKeys("ctrl+x"))):
16941694
return m, core.CmdHandler(messages.ClearQueueMsg{})
16951695

1696-
case key.Matches(msg, key.NewBinding(key.WithKeys("ctrl+?", "f1"))):
1696+
case key.Matches(msg, key.NewBinding(key.WithKeys("ctrl+h", "f1", "ctrl+?"))):
16971697
// Show contextual help dialog with all currently active key bindings
16981698
return m, core.CmdHandler(dialog.OpenDialogMsg{
16991699
Model: dialog.NewHelpDialog(m.Bindings()),

0 commit comments

Comments
 (0)