Skip to content

fix: use ctrl modifier for session browser shortcuts to avoid search conflict#1656

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:session-search
Feb 9, 2026
Merged

fix: use ctrl modifier for session browser shortcuts to avoid search conflict#1656
dgageot merged 1 commit intodocker:mainfrom
dgageot:session-search

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Feb 9, 2026

Plain s, f, and c keys were intercepted by the star, filter, and copy-id actions before reaching the search text input, making it impossible to search for sessions containing those characters.

Change the key bindings to ctrl+s, ctrl+f, and ctrl+c so that unmodified key presses are forwarded to the search input as expected.

Fixes #1642

Follow up of #1653

@dgageot dgageot requested a review from a team as a code owner February 9, 2026 14:39
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

⚠️ Critical Issue Found: The PR introduces ctrl+c as a key binding for copying session IDs, but this conflicts with the global quit handler and will never work as intended.

Problem

The session browser dialog binds ctrl+c to copy session IDs (lines 45, 309), but HandleQuit() is called before the dialog's key bindings are processed (line 61 in Update()). This means:

  • When users press ctrl+c, the app immediately quits via HandleQuit()
  • The CopyID handler is never reached
  • Users cannot copy session IDs using the advertised shortcut

Evidence

In session_browser.go Update method:

case tea.KeyPressMsg:
    if cmd := HandleQuit(msg); cmd != nil {
        return d, cmd  // ← Returns here for ctrl+c
    }
    // ... later code never reached
    case key.Matches(msg, d.keyMap.CopyID):  // ← Unreachable for ctrl+c

Recommendation

Choose a different key binding for CopyID that doesn't conflict with the global quit handler. Consider:

  • ctrl+y (yank/copy in some editors)
  • ctrl+alt+c (less common, unlikely to conflict)
  • alt+c (modifier but not ctrl)

The original issue #1642 was about conflicts with search input (s, f, c). Using ctrl+s and ctrl+f solves that, but ctrl+c creates a different conflict.

…conflict

Plain 's', 'f', and 'c' keys were intercepted by the star, filter,
and copy-id actions before reaching the search text input, making it
impossible to search for sessions containing those characters.

Change the key bindings to alt+s, alt+f, and alt+c so that unmodified
key presses are forwarded to the search input as expected.

Fixes docker#1642
@dgageot dgageot merged commit b757ab2 into docker:main Feb 9, 2026
5 checks passed
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.

Impossible to search certain sessions

3 participants