Bug Description
The status panel (bottom bar showing jobs, tokens, session info) disappears after using the /fg command to bring a background task to the foreground. Once gone, it never comes back for the rest of the session.
Root Cause
The /fg command handler (handleFgCommand) is missing suspendStatusPanel() / restoreStatusPanel() calls that the normal submitTask → setForeground path correctly includes.
Normal path (✅ correct) — TerminalRepl.java:896-916
suspendStatusPanel(); // line 896
taskManager.setForeground(...);
waitForForeground(out, reader);
renderTaskCompletion(out, result);
taskManager.clearForeground();
restoreStatusPanel(); // line 916
/fg path (❌ missing) — TerminalRepl.java:2800-2811
// No suspendStatusPanel() call
taskManager.setForeground(target.taskId());
waitForForeground(out, reader);
renderTaskCompletion(out, target);
taskManager.clearForeground();
// No restoreStatusPanel() call
Why it causes the panel to vanish
- Without
suspendStatusPanel(), the foreground task writes directly to the terminal, conflicting with JLine's scroll region managed by the Status widget
- Without
restoreStatusPanel(), JLine's Status widget remains in a broken state after the task completes
renderStatusFrame has a guard if (taskManager.hasForegroundTask()) return; (line 1558) — correct during fg task, but after clearForeground the widget is already corrupted
Suggested Fix
// In handleFgCommand, add suspend/restore around the foreground block:
suspendStatusPanel(); // ← add
taskManager.setForeground(target.taskId());
waitForForeground(out, reader);
renderTaskCompletion(out, target);
taskManager.clearForeground();
activeForegroundSink = null;
restoreStatusPanel(); // ← add
Steps to Reproduce
- Start a task (e.g. ask a question)
- Press
Ctrl+Z to background it
- Run
/fg to bring it back to foreground
- After task completes, observe the status panel is gone
Expected Behavior
Status panel should reappear after the /fg task completes, same as normal task flow.
Bug Description
The status panel (bottom bar showing jobs, tokens, session info) disappears after using the
/fgcommand to bring a background task to the foreground. Once gone, it never comes back for the rest of the session.Root Cause
The
/fgcommand handler (handleFgCommand) is missingsuspendStatusPanel()/restoreStatusPanel()calls that the normalsubmitTask → setForegroundpath correctly includes.Normal path (✅ correct) —
TerminalRepl.java:896-916/fgpath (❌ missing) —TerminalRepl.java:2800-2811Why it causes the panel to vanish
suspendStatusPanel(), the foreground task writes directly to the terminal, conflicting with JLine's scroll region managed by the Status widgetrestoreStatusPanel(), JLine's Status widget remains in a broken state after the task completesrenderStatusFramehas a guardif (taskManager.hasForegroundTask()) return;(line 1558) — correct during fg task, but after clearForeground the widget is already corruptedSuggested Fix
Steps to Reproduce
Ctrl+Zto background it/fgto bring it back to foregroundExpected Behavior
Status panel should reappear after the
/fgtask completes, same as normal task flow.