In addition to tab complete for branch names, git has a `help.autoCorrect` config item that allows git to automatically correct typos in command names. I weirdly type "git poush" incredibly often, and it's nice for git to pretend I typed "push".
Or set `push.default` to `current` to have plain `git push origin` push to the same remote name, ignoring the configured upstream (you might also want to set `remote.pushDefault` alongside that).
I have this in my `.zshrc` on my personal machine. I get a kick out of it:
```
function command_not_found_handler() { figlet "lol, $1" }
```
(I think the bash equivalent is `command_not_found_handle`).
This overrides the function that usually prints the `zsh: command not found: foo` message, and instead, mocks you, by printing "lol, foo" (but in big ol' figlet letters).
SL is in a similar, but admittedly much more elaborate, spirit.
I've been using prezto[0] for a long time so I'm not sure anymore if this is integrated in zsh, but at least using prezto I get this when I run a wrong command:
> claer
zsh: correct 'claer' to 'clear' [nyae]? n
zsh: command not found: claer
I am guilty of not reading the docs, but I learnt by experience that n/y/a/e stands for no (run without correction)/yes (correct)/abort (don't run)/edit (manually/interactively)
SL(1): Learn the muscle-memory to send SIGQUIT all the time
Part of this tool’s “charm” is that it traps SIGINT so you truly are forced to watch the animation as a punishment for bad typing, even if you try to send it SIGINT from your keyboard by typing control-C.
Control-backslash sends SIGQUIT on the other hand. This signal cannot be trapped.
Perhaps sl could launch a parent process and a child process, put the child in a different process group, then restart the child if the parent sees it do a core dump?
Or launch two children — one of them daemonized — where the daemon attaches a new sl to your terminal if it sees its sibling one die prematurely. You could still get back to an interactive shell with the right signal but sl would keep annoying you by drawing a train over the top.
Used this years ago. It is funny the first few times and then not.
Cures nothing but frustrates the hell out, especially when you are in a hurry (and that's when you make the most typos).
I so often type "nevermind" instead of "never mind" that I created a shortcut on my computer that replaces the former with the latter. I have met many other people of my generation (early 40s) who also thought it was a single word. I think we were influenced by the popular Nirvana album, which used the single-word spelling.
If enough people spell something "wrong" it automatically becomes the correct (or rather, standard) spelling, and words can have more than one correct spelling, too.
Clearly you needed to be born a little earlier so you could instead have been influenced by the proper diction of Never Mind the Bollocks, Here's the Sex Pistols.
This sounded interesting but too magicky to me and I did a google search. Most of the top results are about how to disable or limit it. :)
I believe I experienced this kind of feature with fish and it was one of the reasons I didn't like it. (Most things cannot be user configured away in fish).
At a previous job, someone (with the permission to do so) installed this on a shared server, which led to one of the more ridiculous security incident tickets I saw there.
My first job was at a company where this was installed system wide on all remote linux boxes. Everytime you type sl it would take over the whole terminal for a couple of seconds leaving you unable to do anything. This was before docker & devops era so we used to ssh into machines at lot.
It was the thing that prompted me to learn tmux so I could switch tabs without needing multiple putty windows.
The original use case went away long back, but I use tmux still, so thanks I guess :)
I was surprised when I first came across this, to know that this was apparently such a common typo - since I don't ever recall doing this particular typo myself, even though I'm prone to character-transposition typos.
But then I realized, I rarely ever do `ls` itself - it's always either `ll` = alias for `ls -lh` or `la` = alias for `ll -A`. And those seem less typo prone, somehow.
For many years it’s one of the first things I install just because I enjoy the whimsy. I’ve never reversed ls by accident though, I didn’t even realize it was a play on ls.
I have a script called wq in my path, that echoes "haha!", when I type ;wq in my shell. That is because I have swapped colon and semicolon in my vimrc.
Found it in my .bashrc once. That was a good trick. Now any time a buddy and I share have a login on one another's machine, the ssh motd is an ASCII train that says "toot toot".
It is probably rare but, but if you spend most of your time on the command line it is sort of like tripping over nothing -- sticks in your memory. Particularly if it happens around other people.
“Any time - any time - you type any remotely incorrect command, the interpreter creatively resolves it into rm -rf / and wipes your hard drive.”