diff --git a/ui-tui/src/__tests__/constants.test.ts b/ui-tui/src/__tests__/constants.test.ts index d069d24c2d..318ae71421 100644 --- a/ui-tui/src/__tests__/constants.test.ts +++ b/ui-tui/src/__tests__/constants.test.ts @@ -26,6 +26,11 @@ describe('constants', () => { }) }) + it('documents Ctrl/Cmd+L as non-destructive redraw', () => { + expect(HOTKEYS.some(([, d]) => d === 'redraw / repaint')).toBe(true) + expect(HOTKEYS.some(([, d]) => d.includes('new session'))).toBe(false) + }) + it('TOOL_VERBS maps known tools (verb-only, no emoji)', () => { expect(TOOL_VERBS.terminal).toBe('terminal') expect(TOOL_VERBS.read_file).toBe('reading') diff --git a/ui-tui/src/__tests__/createSlashHandler.test.ts b/ui-tui/src/__tests__/createSlashHandler.test.ts index dba3548712..005ff7387f 100644 --- a/ui-tui/src/__tests__/createSlashHandler.test.ts +++ b/ui-tui/src/__tests__/createSlashHandler.test.ts @@ -26,7 +26,7 @@ describe('createSlashHandler', () => { expect(ctx.gateway.gw.request).not.toHaveBeenCalled() }) - it('persists typed /model switches by default', async () => { + it('keeps typed /model switches session-scoped by default', async () => { patchUiState({ sid: 'sid-abc' }) const ctx = buildCtx({ @@ -40,7 +40,7 @@ describe('createSlashHandler', () => { expect(ctx.gateway.rpc).toHaveBeenCalledWith('config.set', { key: 'model', session_id: 'sid-abc', - value: 'x-model --global' + value: 'x-model' }) }) diff --git a/ui-tui/src/app/slash/commands/session.ts b/ui-tui/src/app/slash/commands/session.ts index a31a4cbe43..e4e2d71c4f 100644 --- a/ui-tui/src/app/slash/commands/session.ts +++ b/ui-tui/src/app/slash/commands/session.ts @@ -16,17 +16,9 @@ import { patchOverlayState } from '../../overlayStore.js' import { patchUiState } from '../../uiStore.js' import type { SlashCommand } from '../types.js' -const GLOBAL_MODEL_FLAG_RE = /(?:^|\s)--global(?:\s|$)/ - const TUI_SESSION_MODEL_RE = new RegExp(`(?:^|\\s)${TUI_SESSION_MODEL_FLAG}(?:\\s|$)`) const TUI_SESSION_STRIP_RE = new RegExp(`\\s*${TUI_SESSION_MODEL_FLAG}\\b\\s*`, 'g') -const persistedModelArg = (arg: string) => { - const trimmed = arg.trim() - - return !trimmed || GLOBAL_MODEL_FLAG_RE.test(trimmed) ? trimmed : `${trimmed} --global` -} - const stripTuiSessionFlag = (trimmed: string) => trimmed.replace(TUI_SESSION_STRIP_RE, ' ').replace(/\s+/g, ' ').trim() @@ -41,7 +33,7 @@ const modelValueForConfigSet = (arg: string) => { return stripTuiSessionFlag(trimmed) } - return persistedModelArg(trimmed) + return trimmed } export const sessionCommands: SlashCommand[] = [ diff --git a/ui-tui/src/app/useInputHandlers.ts b/ui-tui/src/app/useInputHandlers.ts index 0441c1d2c7..7843fc6288 100644 --- a/ui-tui/src/app/useInputHandlers.ts +++ b/ui-tui/src/app/useInputHandlers.ts @@ -379,13 +379,8 @@ export function useInputHandlers(ctx: InputHandlerContext): InputHandlerResult { } if (isAction(key, ch, 'l')) { - if (actions.guardBusySessionSwitch()) { - return - } - - patchUiState({ status: 'forging session…' }) - - return actions.newSession() + clearSelection() + return patchUiState(state => ({ ...state })) } if (isVoiceToggleKey(key, ch)) { diff --git a/ui-tui/src/content/hotkeys.ts b/ui-tui/src/content/hotkeys.ts index 9a079fd2c6..50c293acd8 100644 --- a/ui-tui/src/content/hotkeys.ts +++ b/ui-tui/src/content/hotkeys.ts @@ -19,7 +19,7 @@ export const HOTKEYS: [string, string][] = [ ...copyHotkeys, [action + '+D', 'exit'], [action + '+G / Alt+G', 'open $EDITOR (Alt+G fallback for VSCode/Cursor)'], - [action + '+L', 'new session (clear)'], + [action + '+L', 'redraw / repaint'], [paste + '+V / /paste', 'paste text; /paste attaches clipboard image'], ['Tab', 'apply completion'], ['↑/↓', 'completions / queue edit / history'],