-
- setTaskFocusedPanel(props.task.id, `shell-toolbar:${shellToolbarIdx()}`)
- }
- onFocus={() => setShellToolbarFocused(true)}
- onBlur={() => setShellToolbarFocused(false)}
- onKeyDown={(e) => {
- // Alt+Arrow is handled by global shortcuts (grid navigation)
- if (e.altKey) return;
- const itemCount = 1 + projectBookmarks().length;
- if (e.key === 'ArrowRight') {
- e.preventDefault();
- const next = Math.min(itemCount - 1, shellToolbarIdx() + 1);
- setShellToolbarIdx(next);
- setTaskFocusedPanel(props.task.id, `shell-toolbar:${next}`);
- } else if (e.key === 'ArrowLeft') {
- e.preventDefault();
- const next = Math.max(0, shellToolbarIdx() - 1);
- setShellToolbarIdx(next);
- setTaskFocusedPanel(props.task.id, `shell-toolbar:${next}`);
- } else if (e.key === 'Enter') {
- e.preventDefault();
- const idx = shellToolbarIdx();
- if (idx === 0) {
- spawnShellForTask(props.task.id);
- } else {
- const bm = projectBookmarks()[idx - 1];
- if (bm) runBookmarkInTask(props.task.id, bm.command);
- }
- }
- }}
- style={{
- height: '28px',
- 'min-height': '28px',
- display: 'flex',
- 'align-items': 'center',
- padding: '0 8px',
- background: 'transparent',
- gap: '4px',
- outline: 'none',
- }}
- >
-
-
- {(bookmark, i) => (
-
- )}
-
-
-
0}>
-
-
- {(shellId, i) => {
- const initialCommand = consumePendingShellCommand(shellId);
- let shellFocusFn: (() => void) | undefined;
- let registeredKey: string | undefined;
-
- // Re-register focus fn whenever the index changes (e.g. after a sibling is removed)
- createEffect(() => {
- const key = `${props.task.id}:shell:${i()}`;
- if (registeredKey && registeredKey !== key) unregisterFocusFn(registeredKey);
- if (shellFocusFn) registerFocusFn(key, shellFocusFn);
- registeredKey = key;
- });
- onCleanup(() => {
- if (registeredKey) unregisterFocusFn(registeredKey);
- });
-
- const isShellFocused = () =>
- store.focusedPanel[props.task.id] === `shell:${i()}`;
-
- return (
- setTaskFocusedPanel(props.task.id, `shell:${i()}`)}
- >
-
-
-
- Process exited ({shellExits[shellId]?.exitCode ?? '?'})
-
-
-
markAgentOutput(shellId, data, props.task.id)}
- onExit={(info) =>
- setShellExits(shellId, {
- exitCode: info.exit_code,
- signal: info.signal,
- })
- }
- onReady={(focusFn) => {
- shellFocusFn = focusFn;
- if (registeredKey) registerFocusFn(registeredKey, focusFn);
- }}
- fontSize={Math.round(11 * getFontScale(`${props.task.id}:shell`))}
- autoFocus
- />
-
- );
- }}
-
-
-
-
-