0

I've been trying to find a way to access and edit the c# console screen buffer for a terminal based text editor, and I would rather not have to "redraw" the screen every time I need to update it.

I have tried getting the stdout stream with Console.OpenStandardOutput() and resetting the position but I get: System.NotSupportedException: Stream does not support seeking.

Any insight on how to do this would be amazing.

  • If you can bear it (and you're running under Windows) you can use P/Invoke to call `WriteConsole`: http://pinvoke.net/default.aspx/kernel32/WriteConsole.html – Matthew Watson Jul 10 '23 at 15:12
  • I wrote an answer for something similar a while back. It's still relevant: https://stackoverflow.com/a/70072916/6594467 It uses `Kernel32.WriteConsoleOutput`. – Hank Jul 10 '23 at 15:13
  • Ideally it would not be exclusively a windows application. – Bernard Putnam Sproul Jul 10 '23 at 15:20

0 Answers0