SL(1): Cure your bad habit of mistyping
github.com
github.com
“Any time - any time - you type any remotely incorrect command, the interpreter creatively resolves it into rm -rf / and wipes your hard drive.”
I don't know how I would live without that. I tend to make rather verbose branch names and typing it all out stuff like push would take forever.
Though, you have a much more fun solution.
```
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.
> 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)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.
Yes, it can.
[alias]
git = !sl
catches e.g. `git git status`, which I run shockingly often. $ never mind
-bash: never: command not found
Thought I was about to learn about a new utility for a moment. # some common typos
alias grpe grep
alias gpre grep
alias mroe more
alias mreo more
alias rmeo more alias cd..="cd .."
alias ..="cd .."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).
alias sl=ls
Watch productivity skyrocketIt 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 :)
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.
alias ll='ls -Glopa'
and while I was at it alias cls='clear && printf \\e[3J'
Yes, I grew up using MS DOS, why do you ask?Does not the -o make both the -G and -l unnecessary?