fix(shortcuts): Ctrl+W no longer closes a session

Close Session was bound to Ctrl+W by default. Ctrl+W is delete-word in
every shell, readline prompt and agent CLI, so muscle memory killed the
session (its tmux pane and CLI, with no confirm) mid-sentence, and with
the split pane open it was not even the pane being typed in.

Close Session now has no default key: the capture-phase handler lets
Ctrl+W through and xterm sends ^W to whichever pane is focused. The
action stays in the registry and can be bound in App Settings ->
Shortcuts; the shortcut overlay shows it as not bound. The Help modal,
CLAUDE.md, the split and tile-grid specs and three wiki pages stop
advertising Ctrl+W as kill. Owner decision (tile-grid decision 5).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer
2026-10-06 15:46:49 +02:00
parent 9e032bdc3e
commit bcdccd14c4
13 changed files with 155 additions and 33 deletions
+11 -1
View File
@@ -419,7 +419,14 @@ const DEFAULT_SHORTCUTS = [
id: 'close-session',
group: 'Session',
label: 'Close Session',
bindings: [{ modifiers: ['ctrl'], key: 'w' }],
// ⚠️ No default key. This used to be Ctrl+W, which is "delete the previous
// word" in every shell, readline prompt and agent CLI, so muscle memory
// killed the session (tmux and the CLI, with no confirm) mid-sentence, and
// with the split open it was not even the pane being typed in. Ctrl+W now
// reaches the terminal like any other key. Closing stays on the tab's close
// control and menu (with their confirm), and anyone who wants a key binds
// one in App Settings → Shortcuts.
bindings: [],
action: 'killActiveSession',
},
{
@@ -9134,6 +9141,9 @@ class CodemanApp {
const fmtBindings = (s) => {
if (s.displayBindings) return s.displayBindings.map((b) => `<kbd>${escapeHtml(b)}</kbd>`).join(' / ');
if (!s.bindings) return '';
// An action with no key (Close Session by default) is still listed, so the
// overlay says so instead of showing an empty key column.
if (s.bindings.length === 0) return '<span class="shortcut-overlay-unbound">not bound</span>';
return s.bindings.map((b) => {
const parts = [...(b.modifiers || []).map((m) => m.charAt(0).toUpperCase() + m.slice(1)), b.key || b.code || ''];
return `<kbd>${escapeHtml(parts.join('+'))}</kbd>`;
-1
View File
@@ -807,7 +807,6 @@
<section class="shortcut-section">
<h4>Session</h4>
<div class="shortcuts-grid">
<div><kbd>Ctrl</kbd>+<kbd>W</kbd></div><div>Close Session</div>
<div><kbd>Ctrl/Cmd/Option</kbd>+<kbd>K</kbd></div><div>Find Open Session</div>
<div><kbd>Ctrl</kbd>+<kbd>Tab</kbd></div><div>Next Session</div>
<div><kbd>Alt/Option</kbd>+<kbd>[</kbd> / <kbd>Alt/Option</kbd>+<kbd>]</kbd></div><div>Previous / Next Session</div>
+6
View File
@@ -8520,6 +8520,12 @@ kbd {
color: var(--text-dim);
}
/* An action with no key bound (Close Session by default): say so, quietly. */
.shortcut-overlay-unbound {
font-size: 0.75rem;
font-style: italic;
}
.shortcut-overlay-footer {
margin-top: 0.75rem;
padding-top: 0.75rem;