Aliasing cat or any other ubiquitous shell utility to a replacement is a mistake. Garuda did this, and it was driving me crazy why cat was giving me errors. Turns out that they had aliased bat to cat, and since bat is a different program, it didn’t work in exactly the same way, and an update had introduced some unexpected behavior.
Drop-in replacements are dumb. Just learn to use a different command.
history | fzf
alias cat="bat --plain --theme=gruvbox-dark"
Aliasing
cat
or any other ubiquitous shell utility to a replacement is a mistake. Garuda did this, and it was driving me crazy whycat
was giving me errors. Turns out that they had aliasedbat
tocat
, and sincebat
is a different program, it didn’t work in exactly the same way, and an update had introduced some unexpected behavior.Drop-in replacements are dumb. Just learn to use a different command.
I think it’s ok to add this in a personal
.zshrc
, not on a distro level:If it breaks something - I’d probably know why and can easily fix it by removing alias/calling cat directly.
Also, scripts almost always use bash or sh in shebang, not zsh. So it only triggers if I type
cat
in terminal.Also, even zsh scripts don’t read your .zshrc by default.