Skip to content

Add ANSI statusline support#5314

Open
Copilot wants to merge 3 commits into
developfrom
copilot/add-ansi-statusline-support
Open

Add ANSI statusline support#5314
Copilot wants to merge 3 commits into
developfrom
copilot/add-ansi-statusline-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

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

    • Added IApplication.StatusLine / Application.StatusLine.
    • Added graceful no-op behavior when the active driver cannot emit ANSI statusline output.
  • Statusline-only mode

    • Added AppModel.StatusLine.
    • Constrains the app surface to one terminal-width row and emits rendered content via OSC title/statusline output.
  • UICatalog coverage

    • Added ANSI StatusLine for secondary statusline output from a normal app.
    • Added ANSI StatusLine Only for whole-app statusline rendering.
using IApplication app = Application.Create ();
app.Init ();

app.StatusLine.SetText ("Build: passing", mode: 2);
using IApplication app = Application.Create ();
app.AppModel = AppModel.StatusLine;
app.Init ();

app.Run<MyStatusLineRunnable> ();

Pull Request checklist:

  • I've named my PR in the form of "Fixes #issue. Terse description."
  • My code follows the style guidelines of Terminal.Gui - if you use Visual Studio, hit CTRL-K-D to automatically reformat your files before committing.
  • My code follows the Terminal.Gui library design guidelines
  • I ran dotnet test before commit
  • I have made corresponding changes to the API documentation (using /// style comments)
  • My changes generate no new warnings
  • I have checked my code and corrected any poor grammar or misspellings
  • I conducted basic QA to assure all features are working

Copilot AI assigned Copilot and tig May 15, 2026
Copilot AI linked an issue May 15, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits May 15, 2026 18:46
Copilot AI changed the title [WIP] Add ANSI statusline support for Terminal.Gui Add ANSI statusline support May 15, 2026
Copilot finished work on behalf of tig May 15, 2026 18:54
Copilot AI requested a review from tig May 15, 2026 18:54
@tig tig marked this pull request as ready for review May 15, 2026 19:21
@tig
Copy link
Copy Markdown
Member

tig commented May 15, 2026

@BDisp would you please try this out locally?

Copy link
Copy Markdown

@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: 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".

Comment on lines +94 to +99
if (AppModel == AppModel.StatusLine)
{
SetTerminalTitle (GetStatusLineText (_outputBuffer), 2);

return;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot if someone tries to use appmodel.statusline on a legacy term, an exception should be thrown.

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.

Add ANSI statusline support

2 participants