Add ANSI statusline support#5314
Conversation
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/a1ce3cff-d5a8-49cb-82fc-63650c5daf11 Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/a1ce3cff-d5a8-49cb-82fc-63650c5daf11 Co-authored-by: tig <585482+tig@users.noreply.github.com>
|
@BDisp would you please try this out locally? |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c9edd42d9
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (AppModel == AppModel.StatusLine) | ||
| { | ||
| SetTerminalTitle (GetStatusLineText (_outputBuffer), 2); | ||
|
|
||
| return; | ||
| } |
There was a problem hiding this comment.
Fall back to normal refresh when statusline output unsupported
When AppModel.StatusLine is active, Refresh() always returns immediately after SetTerminalTitle(...); on legacy consoles (IsLegacyConsole == true), SetTerminalTitle is a no-op, so the method exits without drawing anything at all. This makes statusline-mode apps completely invisible on unsupported terminals (for example Windows consoles without VT), rather than degrading gracefully. Consider checking support before early-returning and using the normal buffer render path when title/statusline output is unavailable.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@copilot if someone tries to use appmodel.statusline on a legacy term, an exception should be thrown.
Fixes
Terminal.Gui can now render lightweight status information to ANSI terminal chrome/title regions, and can run a one-row app entirely through that statusline render path.
Proposed Changes/Todos
Application API
IApplication.StatusLine/Application.StatusLine.Statusline-only mode
AppModel.StatusLine.UICatalog coverage
ANSI StatusLinefor secondary statusline output from a normal app.ANSI StatusLine Onlyfor whole-app statusline rendering.Pull Request checklist:
CTRL-K-Dto automatically reformat your files before committing.dotnet testbefore commit///style comments)