question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support alternate screen buffer?

See original GitHub issue

Is your feature request related to a problem? Please describe. Be neat if main and alt buffers were supported. I want my app to do everything in one buffer then switch back to the main one on exiting and restore the original screen buffer

Describe the solution you’d like Maybe something like

AnsiConsole.Console.SetBuffer(Buffer.Main)
AnsiConsole.Console.SetBuffer(Buffer.Alternate)

Describe alternatives you’ve considered

AnsiConsole.Console.Write(Segment.Control("\u001b[?1049h")); // alternate
// do stuff
AnsiConsole.Console.Write(Segment.Control("\u001b[?1049l")); // main

Additional context This might be cruising for a bruising. Just playing with it by sending in the escape codes by hand screws with things it seems. E.g. tables for some reason get rendered on both on my test app.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
patriksvenssoncommented, Jan 30, 2021

@phil-scott-78 I’ve been thinking a bit. We could add new capabilities to the Profile so the user can check if it’s supported or not, and simply throw an exception if we’re on a terminal we know can’t handle it.

I’m reopening this issue.

0reactions
phil-scott-78commented, Apr 8, 2021

@Entomy, have you seen PR #308 yet? If not that’s even better. I think the implementation you came up with is inline with what @patriksvensson came up with too, but we stalled out right before the finish line looking for confirmation that we were in a good place with the implementation.

If you get a chance could you pull it down and provide any feedback on how it compared with your solution e.g. why ref struct, etc.

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Display or hide the alternate screen in Terminal on Mac
There are two screen buffers for each window in Terminal. The main screen buffer contains a log of all output to the window....
Read more >
Using the "alternate screen" in a bash script
It is like a different buffer of the terminal content, which disappears when the application exits, so the whole terminal gets restored and...
Read more >
Console Screen Buffers - Windows ...
It is recommended to use the alternate buffer mode going forward, if possible, instead of creating a second screen buffer for this purpose....
Read more >
How less works: the terminal's alternative buffer
This alternate screen is a feature supported by most terminals, including xterm . We can therefore make a simpler crappy less reimplementation ...
Read more >
terminal - Make usual programs use the alternate screen
In all cases, the last N lines of scrollback buffer have been overwritten. I checked this on various machines over time, and in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found