fix(tui): make Ctrl+B directly background the active foreground shell (#3032)

Previously Ctrl+B opened a two-step ShellControlView menu (Background /
Cancel).  Now it directly calls request_foreground_shell_background(),
backgrounding the running foreground shell in one keystroke.

When no foreground shell is running, the existing status message
("No foreground shell command to background") provides the hint.

The ShellControlView and open_shell_control() remain available as a
programmatic entry point for views/tests.
This commit is contained in:
Hunter Bown
2026-06-10 15:59:40 -07:00
parent b23067bacd
commit 502fb04c23
+6 -1
View File
@@ -3340,7 +3340,12 @@ async fn run_event_loop(
&& key.modifiers.contains(KeyModifiers::CONTROL)
&& app.view_stack.is_empty()
{
open_shell_control(app);
// #3032: Ctrl+B directly backgrounds the active foreground
// shell command instead of opening a two-step shell-control
// menu. When nothing is backgroundable, the status message
// tells the user what's going on.
request_foreground_shell_background(app);
app.needs_redraw = true;
continue;
}