feat(core): add OSC 9;4 progress indicator support to TUI#33325
Merged
FrozenPandaz merged 1 commit intomasterfrom Nov 3, 2025
Merged
feat(core): add OSC 9;4 progress indicator support to TUI#33325FrozenPandaz merged 1 commit intomasterfrom
FrozenPandaz merged 1 commit intomasterfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit 08e2161
☁️ Nx Cloud last updated this comment at |
Contributor
|
Why name it after ghostty when it is not really ghostty specific though? |
683981f to
cc278ce
Compare
Contributor
Author
Good point. Thanks! |
Adds support for terminal progress indicators using the OSC 9;4 escape sequence. This displays task completion progress in the terminal window chrome (tabs, title bars) for compatible terminals. Key features: - Real-time progress updates as tasks complete - Automatic cleanup on TUI exit - Uses ST terminator for maximum compatibility - Writes to stderr to avoid conflicts with TUI rendering Supported terminals: - Ghostty (full support) - Windows Terminal v1.6+ (full support) - VTE-based terminals like GNOME Terminal and Ptyxis (full support) - Other terminals gracefully ignore the sequences cleanup(core): consolidate terminal progress clearing in app instance Add std::io::Write to top-level imports in lifecycle.rs and app.rs, move restore_terminal to instance method on AppLifeCycle to reuse app.clear_terminal_progress() instead of duplicating logic, and remove redundant local imports from functions. cleanup(core): remove redundant progress update in start_tasks The terminal progress indicator only changes when tasks transition from incomplete to completed states. Starting tasks (NotStarted → InProgress) doesn't change the percentage, making this call redundant. cleanup(core): cache incomplete task count for progress calculation Maintain incomplete_task_count on the App struct instead of recalculating it every time we update terminal progress. This avoids iterating through the entire task_status_map on each status update. cleanup(core): cache incomplete task count for progress calculation Maintain incomplete_task_count on the App struct instead of recalculating it every time we update terminal progress. This avoids iterating through the entire task_status_map on each status update. cleanup(core): cache incomplete task count for progress calculation Maintain incomplete_task_count on the App struct instead of recalculating it every time we update terminal progress. This avoids iterating through the entire task_status_map on each status update. cleanup(core): move restore_terminal back to standalone function Make clear_terminal_progress a static method in App so it can be called without an instance. Convert restore_terminal back to a standalone #[napi] function in lifecycle.rs rather than an instance method on AppLifeCycle.
84bf1b6 to
08e2161
Compare
AgentEnder
approved these changes
Nov 3, 2025
Contributor
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Behavior
The Nx TUI doesn't provide any visual feedback about task progress outside of the terminal window itself. Users need to keep the terminal visible to see task completion status.
Expected Behavior
With this PR, the TUI now displays real-time task completion progress in the terminal window chrome (tabs, title bars, dock icons) using the OSC 9;4 escape sequence. This provides at-a-glance progress feedback even when the terminal is minimized or in the background.
Related Issue(s)
N/A - This is a new feature enhancement
Implementation Details
What is OSC 9;4?
OSC 9;4 is a terminal escape sequence for displaying progress indicators, originally from ConEmu and now supported by multiple modern terminals.
Key Changes
update_ghostty_progress()method to calculate and display task completion percentageclear_ghostty_progress()method to hide progress when done\x1b\\) for maximum terminal compatibilitySupported Terminals
Terminal Compatibility Note
The implementation uses the ST (String Terminator) escape sequence rather than BEL, as this is preferred by Ghostty and required by VTE-based terminals, while remaining compatible with Windows Terminal.
Testing
Tested with:
The progress indicator updates in real-time as tasks complete and clears automatically when the TUI exits.