This 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.
Clear Your Terminal in Style
51–60 of 133 posts
Re: Clear Your Terminal in Style
#52Re: Clear Your Terminal in Style
#53Re: Clear Your Terminal in Style
#54If I want the terminal cleared, I want it cleared immediately so that I can go about my next task, or wipe sensitive data from my screen. Adding a delay to the task will annoy me immediately.
Re: Clear Your Terminal in Style
#55Earlier quoted context omitted.
> Ctrl+L works when a program is running. Clear does not. I can't see how because ctrl+l is a $SHELL / readline shortcut rather than one defined in the terminal emulator. Once you run a program you're forking STDIN control to another process so you'd have to wait for the $SHELL / readline prompt again just like you would if you typed a command / function / alias into the command prompt.
Is ctrl+c handled; by the terminal emulator? ctrl+l allows to clear when the prompt is non-empty, maybe parent poster meant that
Re: Clear Your Terminal in Style
#56Earlier quoted context omitted.
I have mapped capslock to ctrl (esc if used without modifiers) which made ctrl+L extremely comfortable for me.
I don’t quite understand why. With one hand or two?
Re: Clear Your Terminal in Style
#57Earlier quoted context omitted.
Unfortunately, Emacs uses CTRL+L to scroll the text buffer so that the caret is in the center. This collision means I often clear terminals by accident.
All the more reason for you to finally bite the bullet and make the switch to the superior editor /s
Re: Clear Your Terminal in Style
#58> This gives roughly a 1 in 10 chance of do_this running, and a 9 in 10 chance of do_that running.
`do_that` having a 9 in 10 chance depends on `do_this` having a 0 chance of returning a falsy status.
Re: Clear Your Terminal in Style
#59I’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.
Re: Clear Your Terminal in Style
#60Earlier quoted context omitted.
It's also super helpful when you want to run one command which spews out a bunch of errors, and then read the first error. Cmd-K, enter, and fling up the the trackpad. I think I'd have to pipe to less if I don't have cmd-K.
Cmd up and down navigates between prompts, so you don’t even have to scroll