Skip to content

Quick session switching by number (parity with window switching) #247

@tarikguney

Description

@tarikguney

Problem

Switching between sessions is significantly slower than switching between windows:

  • Window switching is fast — PREF <number> jumps directly to a window.
  • Session switching requires PREF s to open the session picker, then arrow keys up/down until the target session is found. For users with many sessions this is tedious.

Additionally, while the session picker is open, numeric keys pass through to the underlying terminal as input instead of being consumed by the picker. So even if a user intuitively tries to "just type the number," it doesn't work — and it has the side effect of injecting digits into whatever is running in the focused pane.

Proposal

Make the session picker consume digit keys into a jump buffer, then jump to the numbered entry when Enter is pressed. While the picker opened by PREF s is visible:

  • 1..9, 0 — append to a jump buffer, displayed at the bottom of the picker as go to 12 while mid-entry
  • Enter — parse buffer as a 1-based index and jump to that entry; if the buffer is empty, fall back to the arrow-cursor selection (existing behavior, unchanged)
  • Backspace — delete the last digit from the buffer
  • Esc — clear the buffer and close the picker
  • Up/Down — arrow cursor navigation (unchanged)
  • x — kill the session at the arrow cursor (unchanged)

Additional UX changes folded in:

  • Every row is numbered with a right-aligned dynamic-width column, so the digit→session mapping is visible without trial and error.
  • Overlay height is sized to the entry count rather than a fixed 20 lines — previously left a lot of empty space for short lists.
  • While the picker is open, no character key escapes to the focused pane's PTY (fixes the pre-existing input-leakage side effect).

Out-of-range or unparseable buffer on Enter is a silent no-op — buffer stays so the user can Backspace and fix. Killing a session clears the buffer to avoid stale indexes.

Environment

  • psmux version: 3.3.3
  • OS: Windows 11
  • Terminal: Windows Terminal

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions