Clearing the Terminal
Closed this issue · 1 comments
Right now, when you run the program, it runs the linux command "clear", and clears the entire terminal. This wouldn't be a problem, but once the program is done, the terminal has still been cleared and history is gone.
I look at programs like sl to try to figure out how they temporarily cleared the screen, but it looks like they used the curses library to do what I'm looking to do. I've always been one to shy away from libraries (probably just because I'm hard headed and would rather understand the code than just accept that it works and move on), but I may start using curses to make my life a lot easier in general, since I am basiccally creating a terminal-based GUI.
As of version 1.3.2, this bug officially shouldn't be a problem anymore.
There's two escape sequences that allow you to go to an "alternate screen" and the "original screen". Using these escape sequences allows the program to save the terminal history.
For future reference, these two escape sequences are:
Alternate: \e[?1049h
Original: \e[?1049l