-
Notifications
You must be signed in to change notification settings - Fork 728
feat(tui): progress bar #1162
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
feat(tui): progress bar #1162
Conversation
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a progress bar feature using OSC9 terminal escape sequences to provide visual feedback during AI agent operations. The implementation shows progress during long-running agent tasks in both interactive TUI and non-interactive CLI modes.
- Adds OSC9 progress bar support using the
ansi
package - Integrates progress events into the agent lifecycle to show/hide progress bars
- Updates dependencies to support the new progress bar functionality
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
internal/tui/tui.go | Handles progress bar events in TUI mode using OSC9 sequences |
internal/llm/agent/agent.go | Publishes progress events at agent start/completion |
internal/app/app.go | Shows progress bar in non-interactive CLI mode |
go.mod | Updates ansi package version for OSC9 support |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
I am wondering if this becomes annoying when the agent is in the loop of changing things, it will be loading all the time 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why, but for me this is not working properly on Ghostty. Shows a small blue square but it doesn't move. Might be a Ghostty issue instead of Crush's, but mentioning still. And yes, I am on thwe latest Ghostty release.
Screen.Recording.2025-09-30.at.10.25.49.mov
make sure you are in latest nightly build - it was broken for me a couple of build ago as well |
You're right. This is fixed on nightly. And it looks good! Screen.Recording.2025-09-30.at.10.37.48.mov |
This is cool! I do think we should test it a bit more. Here's some initial testing on my end in Ghostty. In this case it worked exactly as expected: a.movIn this case the progress stopped partway though: b.movWe should also test on Windows Terminal. @KujTim, can you provide a recording illustrating what you mean about it being annoying? |
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
it seems that, if we don't change the progress bar state, ghostty will hide it after some timeout. reproducible: run this and wait: printf "\033]9;4;3;0;\007"; |
That makes sense. I'll just QA in Windows Terminal, otherwise this looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@meowgorithm my comment was more of a question rather than anything else so I am ok with this getting merged.
WORKS GREAT ON WINDOWS TERMINAL! |
Merged 20 upstream commits while preserving: - OAuth authentication for Claude Max/Pro (claudesub provider) - OAuth authentication for GitHub Copilot (copilotsub provider) - Sub-agent system and custom agent definitions - Auth infrastructure (PKCE, token storage) Conflict resolution: - Accepted upstream version of internal/llm/agent/agent.go - Merged internal/config/load.go to keep both GlobalDataDir() and new helper functions Upstream changes integrated: - Progress bar in TUI (charmbracelet#1162) - MCP notifications support (charmbracelet#967) - Filepath walk limits (charmbracelet#1052) - Stream timeout fixes - Crash reporting improvements - Various bug fixes
use OSC9 progress bar sequence:
CleanShot.2025-09-29.at.17.16.29.mp4