feat(header): Alt+W closes the active session tab, customizable in Settings
The close-with-neighbour-activation logic moved into a shared helper (the strip and the shortcut use the same path). Alt+W is the default because the browser owns Cmd/Ctrl+W on web; desktop users can rebind it — the action is registered as customizable, so it appears in the Settings shortcuts section and the shortcuts help automatically. VS Code is excluded (it has no session tabs).
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { isTerminalEventTarget } from '@/lib/terminalFocus';
|
||||
import { useSessionUIStore } from '@/sync/session-ui-store';
|
||||
import { closeSessionTabAndActivateNeighbour } from '@/lib/sessionTabs';
|
||||
import { useSelectionStore } from '@/sync/selection-store';
|
||||
import * as sessionActions from '@/sync/session-actions';
|
||||
import { normalizeContextPanelDirectoryKey, useUIStore } from '@/stores/useUIStore';
|
||||
@@ -299,6 +300,14 @@ export const useKeyboardShortcuts = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isVSCodeRuntime() && eventMatchesShortcut(e, combo('close_session_tab'))) {
|
||||
e.preventDefault();
|
||||
if (currentSessionId) {
|
||||
closeSessionTabAndActivateNeighbour(currentSessionId);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const matchedNewSessionShortcut = eventMatchesShortcut(e, combo('new_chat'));
|
||||
const matchedWorktreeShortcut = eventMatchesShortcut(e, combo('new_chat_worktree'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user