Support alternate screen buffer?
See original GitHub issueIs 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:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
@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!