Earlier quoted context omitted.
The reset command should clear the scrollback buffer. On older terminals where you'd get a garbled screen if you accidentally cat a binary file, it will give you your ASCII back.
Trying it just now on konsole, it does not. Whether that's because your terminal is following standards or because your terminal is interpreting a terminal command that doesn't actually say anything about scrollback to also clear scrollback, I don't know, and await anyone who does to answer that question. My gut is that the terminal protocol would know nothing about scrollback and thus not have a "clear scrollback" c…
Clear Your Terminal in Style
111–120 of 133 posts
Re: Clear Your Terminal in Style
#112Earlier quoted context omitted.
It's actually an Emacs keybinding, that was added to GNU readline, which is used by Bash; most shells followed suit (either by using readline, or implementing it themselves). Ctrl + l is in Bash, in your case.
While many of the readline keybindings come from Emacs, I would have said the common shell handling of Ctrl-L comes from that ^L is ASCII form-feed, which is "clear the page; start a new page" (in the same way that ^H is ASCII backspace). I hadn't considered Bash C-L to be the same as Emacs C-L, since in Emacs I can hit C-L again to "undo" it (kinda).
I would never have associated that with screen clear.
E: excuse me, of course C-l does the same scrolling in the terminal, it doesn't clear the history of course.
Re: Clear Your Terminal in Style
#113In an average day I open more than 100 terminal windows (alt-escape which opens rxvt-unicode). Use most briefly, then they vanish behind other windows. Every-so-often, when I get in a mess with alt-tab I run killUnusedTerminalsAndBC.sh, which kills the dozen or so bc instances that accumulate, and then kills any terminals which don't have anything running in them. I've done that a couple of times today, just did it a…
Re: Clear Your Terminal in Style
#114PT was the maker of the Sol-20, a 1976-ish CP/M machine.
demo: https://www.youtube.com/watch?v=UjiYQqTWHbo
Source code: http://sol20.org/programs/train.asm
Re: Clear Your Terminal in Style
#115Earlier quoted context omitted.
I'm sort of in the opposite camp — I remember there being a non-trivial reason for moving over to iTerm several years ago, but now it's just become a habit and I can't for the life of me remember why I'm using it still. As for shortcuts — ctrl-K (kill line), ctrl-A (go to start of line), ctrl-E (end of line) are my bread and butter, and work with most shells.
One thing I loved about Macs, even though I haven't used one in years, was that you could use Emacs keybindings with the control key and "standard" keybindings with the command key. Being able to type both C-c and ⌘-c was nice.
Re: Clear Your Terminal in Style
#116Earlier quoted context omitted.
You don't know ctrl+L?
It looks like you're getting downvoted without explanation: Ctrl+L doesn't clear the scrollback, it just scrolls the terminal down.
Also, from `man bash`...
> clear-screen (C-l) Clear the screen leaving the current line at the top of the screen. With an argument, refresh the current line without clearing the screen.
Re: Clear Your Terminal in Style
#117I’d just settle for macOS’ Terminal.app’s ⌘-K, that resets the terminal, and clears all the screen including scroll back window. Something so basic I have it in muscle memory but I haven’t found the equivalent in Linux terminals.
I think this needs a solution -- a keymapping and a function that resets the terminal need to be consciously united.
actually, I think I need a full set of keystrokes for linux. Somehow on ubuntu pressing the command key leads to all the windows rearranging like expose on mac.
sigh.
Re: Clear Your Terminal in Style
#118I’d just settle for macOS’ Terminal.app’s ⌘-K, that resets the terminal, and clears all the screen including scroll back window. Something so basic I have it in muscle memory but I haven’t found the equivalent in Linux terminals.
However I found out that most terminal emus on Linux also have this feature as Ctrl-L.
In gnome-terminal you have to press Ctrl-K to clear the screen, and then Ctrl-L to redraw the prompt.
The bash manual documents Ctrl-L as "Clear the screen leaving the current line at the top of the screen."
Re: Clear Your Terminal in Style
#119Earlier quoted context omitted.
Can substitute a forward slash for the 0 and remove the quotes printf \\33c Another way is to use a program that converts hex to binary. A short script to use when there is no clear, tput, etc, e.g., xxd or nc-data exec echo 1b63 |exec xxd -p -r echo -e '27\n99\n' |exec nc-data -g exec echo |exec sed '1i\ 27 \ 99 ' |exec nc-data -g
\ is a backslash / is a forward slash, a.k.a. simply “slash”
Probably better to just use "escape" for backslash and "slash" for forward slash.
Re: Clear Your Terminal in Style
#120I’d just settle for macOS’ Terminal.app’s ⌘-K, that resets the terminal, and clears all the screen including scroll back window. Something so basic I have it in muscle memory but I haven’t found the equivalent in Linux terminals.
A lot of people swear by stuff like iTerm2, but I'm almost a little ashamed to admit that even though I have iTerm configured to my taste, I often still reach for macOS' native terminal. It's not gloriously beautiful or anything (basic Zsh with powerline for the shell), but it just seems to work great without the frills. Little shortcuts that think of stuff like this without any configuration (iTerms is impressively…