I’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.
You don't know ctrl+L?
Clear Your Terminal in Style
81–90 of 133 posts
Re: Clear Your Terminal in Style
#82Re: Clear Your Terminal in Style
#83Re: Clear Your Terminal in Style
#84Earlier quoted context omitted.
I'm not 100% sure how ctrl+c (and ctrl+z) are handled but I do know they're edge cases because they're managed by the kernel and are not re-definable.
The terminal can optionally catch some characters and convert them to signals. By default, ^C sends SIGINT, ^\ sends SIGQUIT, and ^Z sends SIGTSTP. Programs can disable that for their own purposes (stty -isig) and you can rebind them to other characters if you want (stty intr, stty quit, stty susp) but I don't know why anyone would these days.
Sure, theoretically terminal emulators could capture and even rebind those keys via the APIs of whatever graphical toolkit they're built in....but if you wanted to rebind SIGINT to another key in the terminal emulator, that terminal emulator would still have to transmit ^c to the tty.
As for rebinding those keys in the kernel, Linux simply doesn't support doing that and nor does it support binding other keys to different signals. In fact I've tried to do this on a tool I was working on to emulate BSD's SIGINFO in Linux (turned out not to be possible) as as well part of the job control (SIGSTSP et al) support in my $SHELL (https://github.com/lmorg/murex).
This is also why you can throw signals over an SSH (or other remote shell) session when the terminal emulator itself would have no knowledge of the commands running on the remote host.
Re: Clear Your Terminal in Style
#85ahhh missing a great effect https://github.com/bartobri/no-more-secrets
Re: Clear Your Terminal in Style
#86Every-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 again and killed another 10 hanging around. Most of the rest are idle, but sshed to other servers, so they don't get reaped.
Re: Clear Your Terminal in Style
#87This one should really have a massive "do not try this": [ $[$RANDOM % 6] = 0 ] && sudo rm -rf / || echo "Not today" An awful lot of people just copy and paste things to see what'll happen.
Re: Clear Your Terminal in Style
#88This one should really have a massive "do not try this": [ $[$RANDOM % 6] = 0 ] && sudo rm -rf / || echo "Not today" An awful lot of people just copy and paste things to see what'll happen.
Unfortunately that might just compel them to keep trying.
Re: Clear Your Terminal in Style
#89I’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.
printf "\033c"? I don't know if it resets, but it does clear the scroll buffer. I use it before compiling (printf "\033c"; make) so that I don't have to search for the first error or warning, I can just scroll all the way up.
Sounds like your terminal clears everything? vt100 variants are a, uh, delightful mix of nearly-compatible dialects...
Re: Clear Your Terminal in Style
#90https://github.com/alacritty/alacritty/pull/2329#issuecommen...