fix(tui): #3032 residuals — running-exec hint now says Ctrl+B backgrounds the command; Ctrl+B documented in KEYBINDINGS.md and runbook updated for menu removal; Cannot-background message names the reason (interactive / non-shell tool / nothing running)
Co-Authored-By: Claude <noreply@anthropic.com> https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5
This commit is contained in:
@@ -957,7 +957,7 @@ impl ExecCell {
|
|||||||
));
|
));
|
||||||
} else if self.status == ToolStatus::Running && self.source == ExecSource::Assistant {
|
} else if self.status == ToolStatus::Running && self.source == ExecSource::Assistant {
|
||||||
lines.extend(wrap_plain_line(
|
lines.extend(wrap_plain_line(
|
||||||
" Ctrl+B opens shell controls.",
|
" Ctrl+B backgrounds this command.",
|
||||||
Style::default().fg(palette::TEXT_MUTED),
|
Style::default().fg(palette::TEXT_MUTED),
|
||||||
width,
|
width,
|
||||||
));
|
));
|
||||||
@@ -5075,7 +5075,7 @@ mod tests {
|
|||||||
|
|
||||||
assert!(text.contains("running line 1"));
|
assert!(text.contains("running line 1"));
|
||||||
assert!(text.contains("running line 2"));
|
assert!(text.contains("running line 2"));
|
||||||
assert!(!text.contains("Ctrl+B opens shell controls"));
|
assert!(!text.contains("Ctrl+B backgrounds this command"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -8771,10 +8771,30 @@ fn render_toast_stack_overlay(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn request_foreground_shell_background(app: &mut App) {
|
pub(crate) fn request_foreground_shell_background(app: &mut App) {
|
||||||
if !app.is_loading || !active_foreground_shell_running(app) {
|
if !app.is_loading {
|
||||||
app.status_message = Some("No foreground shell command to background".to_string());
|
app.status_message = Some("No foreground shell command to background".to_string());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if !active_foreground_shell_running(app) {
|
||||||
|
// #3032 AC3: name the reason backgrounding is unavailable —
|
||||||
|
// interactive execs and non-shell blocking tools are visibly running
|
||||||
|
// but cannot be detached, and a generic shrug reads like a bug.
|
||||||
|
let reason = if terminal_pause_has_live_owner(app) {
|
||||||
|
"the running command is interactive"
|
||||||
|
} else if app
|
||||||
|
.active_cell
|
||||||
|
.as_ref()
|
||||||
|
.is_some_and(|active| !active.is_empty())
|
||||||
|
{
|
||||||
|
"the running tool is not a foreground shell command"
|
||||||
|
} else {
|
||||||
|
"no foreground shell command is running"
|
||||||
|
};
|
||||||
|
app.status_message = Some(format!(
|
||||||
|
"Cannot background: {reason}. Press Ctrl+C to cancel the turn, or wait for completion."
|
||||||
|
));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let Some(shell_manager) = app.runtime_services.shell_manager.clone() else {
|
let Some(shell_manager) = app.runtime_services.shell_manager.clone() else {
|
||||||
app.status_message = Some("Shell manager is not attached".to_string());
|
app.status_message = Some("Shell manager is not attached".to_string());
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ Bindings are not (yet) user-configurable — tracked for a future release (#436,
|
|||||||
| `F1` or `Ctrl-/` | Toggle the help overlay |
|
| `F1` or `Ctrl-/` | Toggle the help overlay |
|
||||||
| `Ctrl-K` | Open the command palette (slash-command finder) |
|
| `Ctrl-K` | Open the command palette (slash-command finder) |
|
||||||
| `Ctrl-C` | Cancel current turn / dismiss modal / arm-then-confirm quit |
|
| `Ctrl-C` | Cancel current turn / dismiss modal / arm-then-confirm quit |
|
||||||
|
| `Ctrl-B` | Background the running foreground shell command (turn continues; the command becomes a `/jobs` background job) |
|
||||||
| `Ctrl-D` | Quit (only when the composer is empty) |
|
| `Ctrl-D` | Quit (only when the composer is empty) |
|
||||||
| `Tab` | Cycle TUI mode: Plan → Agent → YOLO → Plan |
|
| `Tab` | Cycle TUI mode: Plan → Agent → YOLO → Plan |
|
||||||
| `Shift-Tab` | Cycle reasoning effort: off → high → max → off |
|
| `Shift-Tab` | Cycle reasoning effort: off → high → max → off |
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Checks:
|
|||||||
3. Confirm no local sandbox/permission deadlock in tool output
|
3. Confirm no local sandbox/permission deadlock in tool output
|
||||||
|
|
||||||
Actions:
|
Actions:
|
||||||
1. If a foreground shell command is running, press `Ctrl+B` and choose whether to background it or cancel the current turn.
|
1. If a foreground shell command is running, press `Ctrl+B` to move it to the background (the turn keeps running and the command becomes a background job under `/jobs`); use `Ctrl+C` instead if you want to cancel the turn.
|
||||||
2. If the command was started in the background, ask the assistant to cancel it with `exec_shell_cancel` and the returned task id.
|
2. If the command was started in the background, ask the assistant to cancel it with `exec_shell_cancel` and the returned task id.
|
||||||
3. Use `Esc` or `Ctrl+C` to interrupt the current turn when you want to stop the request itself.
|
3. Use `Esc` or `Ctrl+C` to interrupt the current turn when you want to stop the request itself.
|
||||||
4. Retry prompt; if still failing, restart TUI.
|
4. Retry prompt; if still failing, restart TUI.
|
||||||
|
|||||||
Reference in New Issue
Block a user