garabik / grc

generic colouriser
http://kassiopeia.juls.savba.sk/~garabik/software/grc.html
Other
1.9k stars 162 forks source link

zsh not sourcing the grc.zsh despite everything been set correctly #220

Closed justkelvin closed 10 months ago

justkelvin commented 2 years ago

zsh will not source the grc.zsh for some weird reason, when I paste the command in the prompt it is getting sourced, but not from my .zshrc file.

arrrgi commented 2 years ago

Are you using a Zsh plugin framework like zsh4humans? I had a very similar issue here https://github.com/romkatv/zsh4humans/issues/218

There are two workarounds at the moment in that scenario:

  1. Source grc.zsh in your .zprofile file
  2. And according to @bkmo, edit grc.zsh and change https://github.com/garabik/grc/blob/f4a579e08d356a3ea00a8c6fda7de84fff5f676a/grc.zsh#L3 to if [[ "$TERM" != dumb ]] && (( $+commands[grc] )) ; then and comment out https://github.com/garabik/grc/blob/f4a579e08d356a3ea00a8c6fda7de84fff5f676a/grc.zsh#L95

Not sure if this is your specific use case but the first workaround was fine for me.

bkmo commented 2 years ago

I would suggest just creating a .zprofile and sourcing it there. No need to mod grc.zsh that way.

arrrgi commented 2 years ago

Also, this workaround from @romkatv if you are using zsh4humans > https://github.com/romkatv/zsh4humans/issues/218#issuecomment-1276387398

bkmo commented 2 years ago

Yes that is the best way to do it in my opinion. z4h source /etc/grc.zsh <$TTY