3 ms·
Using the RIS control sequence is a bad idea. Its long-standing functionality has included completely resetting the serial communications at the terminal end.
by JdeBP 7y ago
Using the RIS control sequence is a bad idea. Its long-standing functionality has included completely resetting the serial communications at the terminal end.
ED (Erase Display) is the control sequence to use for clearing the screen in systems with a terminal I/O paradigm. Emit it twice, as ED 2 to clear the whole main screen and as ED 3 to separately clear the scrollback buffer.
* http://jdebp.uk./FGA/clearing-the-tui-screen.html http://jdebp.uk./FGA/clearing-the-tui-screen.html
- zenexer 7y agoNormally it's not what I'd use, but Windows Terminal still has some quirks. It was the only thing that seemed to work reliably. However, now that I've done additional testing, even that doesn't seem to work reliably. Keep in mind that the context here is finding a workaround for a specific terminal emulator. Very cool link and bit of history, though!
- JdeBP 7y agoThe workaround, which isn't really a workaround at all because it's the standard way of doing this (plus a fairly modest common extension that we terminal emulator authors have mostly agreed upon), has already been found. The Microsoft people in the GitHub issue said to use ED 2 and ED 3, as well. I merely additionally explained why your doing something that they did not suggest is wrong, not only for the reasons that the Microsoft people already said, but for the additional reasons that it has a standard function that is not what is desired here.
- zenexer 7y agoIt doesn't work, though, as I've already explained elsewhere in the comment tree. It works in naive examples, but fails to clear at the correct time in more complex situations.