Repository navigation
feat(cli): Ctrl+B promote keybind (#3831 PR-3 of 3) #3969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ac4a3fc
5560f85
b1405b3
b4e3208
91277e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -102,6 +102,7 @@ import { clearScreen } from '../utils/stdioHelpers.js'; | |||||||||||
| import { useTextBuffer } from './components/shared/text-buffer.js'; | ||||||||||||
| import { useLogger } from './hooks/useLogger.js'; | ||||||||||||
| import { useGeminiStream } from './hooks/useGeminiStream.js'; | ||||||||||||
| import type { TrackedExecutingToolCall } from './hooks/useReactToolScheduler.js'; | ||||||||||||
| import { useVim } from './hooks/vim.js'; | ||||||||||||
| import { isBtwCommand, isSlashCommand } from './utils/commandUtils.js'; | ||||||||||||
| import { type LoadedSettings, SettingScope } from '../config/settings.js'; | ||||||||||||
|
|
@@ -2235,6 +2236,35 @@ export const AppContainer = (props: AppContainerProps) => { | |||||||||||
| setCompactMode(newValue); | ||||||||||||
| void settings.setValue(SettingScope.User, 'ui.compactMode', newValue); | ||||||||||||
| refreshStatic(); | ||||||||||||
| } else if (keyMatchers[Command.PROMOTE_SHELL_TO_BACKGROUND](key)) { | ||||||||||||
|
wenshao marked this conversation as resolved.
Resolved
wenshao marked this conversation as resolved.
Resolved
wenshao marked this conversation as resolved.
Resolved
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The Escape handler at this same level has
Suggested change
— DeepSeek/deepseek-v4-pro via Qwen Code /review |
||||||||||||
| // Ctrl+B: promote a running foreground shell command to a | ||||||||||||
| // background task (#3831). The child keeps running, the | ||||||||||||
| // agent's turn unblocks, and the shell becomes a regular | ||||||||||||
| // BackgroundShellEntry visible in `/tasks` + the dialog and | ||||||||||||
| // stoppable via `task_stop`. | ||||||||||||
| // | ||||||||||||
| // Read from the ref (NOT the destructured `pendingToolCalls`) | ||||||||||||
| // so we don't have to put `pendingToolCalls` in the deps | ||||||||||||
| // array — that would re-bind the keypress handler on every | ||||||||||||
| // tool-call status update, which is noisy. | ||||||||||||
| // | ||||||||||||
| // No-op when no foreground shell is currently executing OR | ||||||||||||
| // the executing tool call is non-shell (no | ||||||||||||
| // `promoteAbortController` projected). Falling through in | ||||||||||||
| // the no-op case is intentional: while the agent is idle the | ||||||||||||
| // input layer's own Ctrl+B handler (cursor-left in the | ||||||||||||
| // prompt) should still fire as before. | ||||||||||||
| const executingShell = pendingToolCallsRef.current.find( | ||||||||||||
|
wenshao marked this conversation as resolved.
Resolved
wenshao marked this conversation as resolved.
Resolved
|
||||||||||||
| (tc) => | ||||||||||||
| tc.status === 'executing' && | ||||||||||||
| tc.promoteAbortController !== undefined, | ||||||||||||
| ) as TrackedExecutingToolCall | undefined; | ||||||||||||
| if (executingShell?.promoteAbortController) { | ||||||||||||
| executingShell.promoteAbortController.abort({ | ||||||||||||
|
wenshao marked this conversation as resolved.
Resolved
|
||||||||||||
| kind: 'background', | ||||||||||||
| }); | ||||||||||||
| return; | ||||||||||||
| } | ||||||||||||
| } | ||||||||||||
| }, | ||||||||||||
| [ | ||||||||||||
|
|
||||||||||||
Uh oh!
There was an error while loading. Please reload this page.