termy-the-terminal
termy-the-terminal copied to clipboard
Clear command
Is there a way to implement a clear command? Would it be doable as a custom command? Sorry I’m still learning react and JavaScript/typescript.
I've have to look into this a bit. I think it might tough to do as a custom command since a clear usually involves "clearing" everything on the screen and moving the prompt to the top of the terminal. I believe you would effectively clear the terminal history display but keep the command history. I'll definitely take it as a feature suggestion, though. Thanks!
Actually, after looking at this a bit more, I think this might be solvable with some CSS/JS. The clear
command is really just about clearing what's rendered on the screen and moving the prompt to the top of the window.
However, you can still scroll up and see all of the previous inputs/results. I'll do some thinking, but maybe this could be solved with something like scrollIntoView
@ctaylo21 That clear method would mimick what happens on most Linux bash terminals and that would be nice at the very least. On Windows command prompt the clear will prevent you from viewing the previous commands/output when you scroll up.
My friend implemented it but I’m not sure if it’s a super elegant solution https://github.com/nk-io/termy-the-terminal