Skip to content

fix(cli): improve terminal output formatting and visual clarity#8025

Merged
michaelneale merged 5 commits intomainfrom
micn/quick-cli-fix
Mar 20, 2026
Merged

fix(cli): improve terminal output formatting and visual clarity#8025
michaelneale merged 5 commits intomainfrom
micn/quick-cli-fix

Conversation

@michaelneale
Copy link
Collaborator

Summary

Minimal fixes to make the legacy CLI output less chaotic. Biggest improvement for smallest change.

Changes (3 files, ~40 lines)

Tool responses: dim plain text instead of bat-markdown (biggest impact)

  • Tool output now renders as indented dim text, visually distinct from assistant prose
  • Truncated to 20 lines by default (respects /toggle for full output)
  • Tool errors render in red dim

Visual boundaries

  • Dim separator line (────────) before each tool call header
  • Blank line after tool output blocks
  • Blank line between user input and assistant response

Stop terminal obliteration

  • Task execution dashboard no longer uses screen-clearing ANSI escapes (\x1b[2J, \x1b[H, etc.) that were wiping terminal content mid-stream

Styled notifications

  • Shell output and task execution notifications render dim+indented instead of raw unstyled print!/println!

Before

Tool output rendered through bat as markdown (same styling as assistant text), no visual separation between tool activity and assistant prose, task execution dashboard clearing the screen, raw notifications dumped between streaming chunks.

After

Clear visual hierarchy: bright text = goose talking, dim indented text = tool activity, separator lines = boundaries between blocks.

- Tool responses render as dim indented plain text instead of through
  bat markdown, making tool output visually distinct from assistant prose
- Tool output truncated to 20 lines by default (respects /toggle)
- Added separator line before tool call headers for clear boundaries
- Added breathing room: blank line after tool output, blank line between
  user input and assistant response
- Disabled screen-clearing ANSI escape codes in task execution display
  that were obliterating terminal content
- Shell output and task execution notifications render dim+indented
  instead of raw unstyled text

Signed-off-by: Michael Neale <michael.neale@gmail.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f7f6b96355

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

- Remove CLEAR_SCREEN/MOVE_TO_PROGRESS_LINE/CLEAR_TO_EOL/CLEAR_BELOW
  constants entirely instead of blanking them to empty strings
- Remove unused theme parameter from render_tool_response
- Fix test that referenced removed MOVE_TO_PROGRESS_LINE constant

Signed-off-by: Michael Neale <michael.neale@gmail.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 578f90250a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@michaelneale michaelneale enabled auto-merge March 20, 2026 01:34
@michaelneale michaelneale disabled auto-merge March 20, 2026 01:38
@michaelneale michaelneale enabled auto-merge March 20, 2026 01:46
@michaelneale michaelneale added this pull request to the merge queue Mar 20, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf8b619c0d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +540 to +543
let max_lines = if get_show_full_tool_output() {
usize::MAX
} else {
20

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Don't truncate tool output in headless TTY sessions

This truncates long tool responses whenever stdout is a terminal, but CliSession::process_message()/headless() still render through render_message_streaming() with interactive = false. As a result, a normal goose run '…' launched from a terminal now drops everything past 20 lines even though there is no input loop where the user could recover the hidden lines, so long shell/read outputs and stack traces become irretrievable in common non-interactive runs.

Useful? React with 👍 / 👎.

Comment on lines +558 to +560
style(format!(
"... ({} lines hidden, /toggle to show all)",
lines.len() - head - tail

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Show the real command for expanding truncated tool output

The truncation banner tells users to run /toggle, but the command parser and help text only expose /r (crates/goose-cli/src/session/input.rs:311 and :414). In interactive sessions the advertised escape hatch for hidden lines will therefore be rejected, so users who hit truncation are pointed at a command that does not exist.

Useful? React with 👍 / 👎.

Comment on lines 83 to 85
if !INITIAL_SHOWN.swap(true, Ordering::SeqCst) {
display.push_str(CLEAR_SCREEN);
display.push_str("🎯 Task Execution Dashboard\n");
display.push_str("═══════════════════════════\n\n");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset the task dashboard header for later executions

The header is now emitted only while INITIAL_SHOWN is false, but after removing the cursor-reposition refresh path nothing preserves that header across separate task executions. Because TasksComplete never clears the flag, the second subrecipe/subagent execution in the same CLI session appends a new block that starts at 📊 Progress with no 🎯 Task Execution Dashboard label, which makes later task runs hard to identify.

Useful? React with 👍 / 👎.

Merged via the queue into main with commit e2fc8dd Mar 20, 2026
23 checks passed
@michaelneale michaelneale deleted the micn/quick-cli-fix branch March 20, 2026 02:01
cloorc pushed a commit to LeafAI/Leaf that referenced this pull request Mar 20, 2026
…k#8025)

Signed-off-by: Michael Neale <michael.neale@gmail.com>
cloorc pushed a commit to LeafAI/Leaf that referenced this pull request Mar 20, 2026
…k#8025)

Signed-off-by: Michael Neale <michael.neale@gmail.com>
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
…k#8025)

Signed-off-by: Michael Neale <michael.neale@gmail.com>
Signed-off-by: esnyder <elijah.snyder1@gmail.com>
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
…k#8025)

Signed-off-by: Michael Neale <michael.neale@gmail.com>
Signed-off-by: esnyder <elijah.snyder1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants