jarun / nnn

n³ The unorthodox terminal file manager
BSD 2-Clause "Simplified" License
19.38k stars 761 forks source link

prompt not respecting aliases defined in .zshrc #1908

Closed Giessen closed 4 months ago

Giessen commented 4 months ago

Environment details (Put x in the checkbox along with the information)

Exact steps to reproduce the issue

  1. nnn -a
  2. press ] to fire prompt
  3. run whatever alias/function xxx defined in .zshrc => got message: xxx not found
  4. source $HOME/.zshrc => no vail....
  5. export a="foo"
  6. echo "$a" => blank

Any ideas, please! Thanks!

Giessen commented 4 months ago

This is actually documented here: https://github.com/jarun/nnn/wiki/concepts : "...Refer to your shell's documentation (e.g. BASH_ENV for bash, ~/.zshenv for zsh) to use aliases and functions. ..."

For anyone who is not aware of .zshrc, .zshenv, .zprofile, .zlogin, .zlogout, etc, here you go: https://unix.stackexchange.com/questions/71253/what-should-shouldnt-go-in-zshenv-zshrc-zlogin-zprofile-zlogout

Giessen commented 4 months ago

I have a related question, how to run command alias via '!' as plugin? This might have been documented/indicated someware in the wiki, but I cannot find out to the best of my effort. Thanks in advance.

N-R-K commented 4 months ago

! simply launches the shell, nnn doesn't do anything special there. On my system aliases work just fine with !.

If it isn't working for you, you need to consult your shell's documentation and make sure your aliases are being loaded properly. I set my aliases in my .zshrc for example.

Giessen commented 4 months ago

Thank you very much for the info.