x_x
x_x copied to clipboard
Use alternate screen to avoid spamming terminal
Right now, all of x_x's output goes to the normal terminal screen, which means that anything that existed in the terminal history before the user ran x_x is completely gone. A solution to this is to have x_x write everything to the alternate screen. The alternate screen is how programs like vim and top manage to avoid spamming the screen. You enable the alternate screen simply by printing an ANSI escape sequence. Here's a basic guide: http://rosettacode.org/wiki/Terminal_control/Preserve_screen#Python
Thats interesting. This program displays the output in less. Looks like the -X
switch does this, so it might be worth removing that.