8000 feat: add a few high-value keyboard shortcuts + shortcut cheat-sheet/tooltips · Issue #64 · amirlehmam/wmux · GitHub
[go: up one dir, main page]

Skip to content

feat: add a few high-value keyboard shortcuts + shortcut cheat-sheet/tooltips #64

Closed

Description

@kevmtt

Motivation< CFD2 /h2>

wmux already ships a strong, remappable shortcut set (38 actions, listed in the Ctrl+Shift+P command palette, editable in Settings → Keyboard) — all the workspace/tab/split basics are done. This issue proposes a small set of high-productivity shortcuts that are still missing vs cmux, plus a discoverability feature. Kept intentionally focused to avoid bloating the shortcut surface.

Already covered (no work needed)

Capability wmux action wmux default cmux equivalent
New workspace newWorkspace Ctrl+N ⌘N
Switch workspace (cycle / index) nextWorkspace / prevWorkspace / built-in Ctrl+PgDn / Ctrl+PgUp / Ctrl+1…9 ⌃⌘] / ⌃⌘[ / ⌘1…9
Jump to workspace with unread notification jumpToUnread Ctrl+Shift+U ⌘⇧U
Rename workspace renameWorkspace Ctrl+Shift+F2 ⌘⇧R
New terminal tab newSurface Ctrl+T ⌘T
Next / previous tab nextSurface / prevSurface Ctrl+Shift+] / Ctrl+Shift+[ ⌘⇧] / ⌘⇧[
Split right / down splitRight / splitDown Ctrl+D / Ctrl+Shift+D ⌘D / ⌘⇧D

The five shortcuts originally requested (new workspace, switch workspace, switch-to-notification, new tab, split) are all in this table — so this issue only adds genuinely new, high-value actions.

Proposed additions (high-value only)

Suggested Windows defaults are collision-checked against current defaults and remappable.

Proposed action What it does Why it's worth it Suggested default cmux
selectSurface1…9 Jump straight to tab N in the focused pane Fast tab switching when juggling several agents/shells Ctrl+Alt+1…9 ⌃1–9
reopenClosedSurface Restore the last-closed tab Universal "oops, brought it back" muscle memory Ctrl+Shift+T ⌘⇧T
findNext / findPrevious Cycle search matches without reopening the find bar Core search ergonomics; currently no next/prev F3 / Shift+F3 ⌘G / ⌥⌘G
resizePaneLeft/Right/Up/Down Grow/shrink the focused pane from the keyboard Daily layout tuning; also sidesteps the mouse-resize pains in #57/#59 Ctrl+Shift+Arrows —
broadcastInput Toggle: typed input + Enter go to all panes in the workspace wmux's "for AI agents" superpower — drive several Claude Code panes at once (tmux synchronize-panes) Ctrl+Alt+B —

Plus one fix, not a new binding: openFolder (Ctrl+O) is already bound but a no-op stub (useKeyboardShortcuts.ts: "needs OS file dialog via IPC, not yet implemented"). Wire it to a folder picker that opens a workspace there.

Workspace actions (act on the active workspace)

These already exist in the sidebar right-click menu (WorkspaceContextMenu.tsx) but have no keyboard equivalent. Each is a one-liner (onUpdateMetadata(active, …) in Sidebar.tsx), targeting the currently active workspace.

Proposed action What it does Why it's worth it Suggested default
togglePinWorkspace Pin / unpin the active workspace Keep important workspaces at the top without reaching for the mouse Ctrl+Alt+P
markWorkspaceRead Clear the unread badge on the active workspace Quickly dismiss the "needs attention" marker after checking a pane Ctrl+Alt+R

Rename is intentionally not listed here — it already has a shortcut (renameWorkspace, Ctrl+Shift+F2). markWorkspaceUnread could be added too for symmetry, but markWorkspaceRead is the high-value one.

Discoverability — cheat-sheet overlay + tooltips

Bindings are currently discoverable only by searching the command palette or digging into Settings. Two small additions teach them in-context (cmux surfaces shortcuts this way):

  • Shortcut cheat-sheet overlay — a toggleable, search-filterable overlay (suggested F1 or Ctrl+/) listing every action grouped by category with its current binding. Reuses the existing formatBinding() helper and the same shortcuts map, so it stays in sync with user remaps.
  • Inline hover tooltips — show the binding on hover over the control that triggers it (new-tab +, split buttons, zoom, sidebar rows), e.g. "New tab — Ctrl+T".

Implementation pointers

  1. Add each action to the ShortcutAction union + DEFAULT_SHORTCUTS (src/renderer/store/settings-slice.ts).
  2. Add a case in dispatchAction() (useKeyboardShortcuts.ts); reuse split-utils.ts helpers and existing store actions (addSurface, selectSurface, …).
  3. Command palette + Keyboard settings pick up new actions automatically (they iterate Object.entries(shortcuts)).
  4. reopenClosedSurface needs a small "recently closed" stack in the surface slice.
  5. For any new bare-Ctrl combo, update SAFE_CTRL_KEYS / isSafeToIntercept().

Acceptance criteria

  • selectSurface1…9, reopenClosedSurface
  • findNext / findPrevious
  • keyboard pane resize (resizePane*)
  • broadcastInput
  • togglePinWorkspace, markWorkspaceRead (active workspace)
  • openFolder no longer a no-op
  • cheat-sheet overlay + inline tooltips
  • all new actions appear in the palette and are remappable in Settings → Keyboard

Activity

  1. added a commit that references this issue on Jun 28, 2026
  2. amirlehmam commented on Jun 28, 2026

    @amirlehmam
    Owner

    Shipped in v0.13.0 (commit 7432593). Walking the acceptance criteria:

    • reopenClosedSurface — Ctrl+Shift+T. Backed by a small reopen stack in surface-slice.ts; restores tab metadata (type / title / shell / cwd / url / startup commands). The terminal restarts fresh since its PTY is gone.
    • findNext / findPrevious — F3 / Shift+F3. Dispatched to the focused, visible terminal's SearchAddon, cycling the last query without reopening the find bar.
    • Keyboard pane resize — resizePane{Left,Right,Up,Down} on Ctrl+Shift+Arrows. New adjustPaneRatio() helper nudges the nearest enclosing divider (move-divider semantics, like tmux resize-pane), clamped to 10–90%.
    • broadcastInput — Ctrl+Alt+B. Toggles fanning your keystrokes to each pane's visible terminal in the workspace (background keep-alive tabs are intentionally skipped). A red banner shows while it's active. Runtime-only — deliberately not persisted, so a dangerous mode never silently restores on launch.
    • togglePinWorkspace (Ctrl+Alt+P) and markWorkspaceRead (Ctrl+Alt+R) on the active workspace.
    • openFolder — Ctrl+O is no longer a no-op. New system:pickFolder IPC handler shows a native directory dialog; the chosen folder opens as a new workspace rooted there.
    • Cheat-sheet overlay — F1, searchable, grouped by category, and it renders your live bindings (so remaps show up immediately). Plus inline tooltips on the tab-bar controls (new-tab, split, close) now show their current binding.
    • Palette + remappable — every new action is in the ShortcutAction union + DEFAULT_SHORTCUTS, so the command palette and Settings → Keyboard pick them up automatically.

    One implementation note on selectSurface1…9: I shipped it as a fixed Ctrl+Alt+1…9 handler that mirrors the existing Ctrl+1…9 workspace-index selector, rather than nine individually-remappable entries — nine extra rows would have bloated the Settings → Keyboard list considerably for a low-collision binding. It's listed in the cheat-sheet under Tabs. Happy to make them remappable if you'd rather.

    While wiring this up I also refactored the keyboard dispatch from a 35-case switch into a handler table, and fixed a latent bug where addSurface returned a freshly-minted id even when the target pane no longer existed (now returns null).

    Defaults were collision-checked against the existing set and all remain remappable. Release: https://github.com/amirlehmam/wmux/releases/tag/v0.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      0