-
Is there a big disadvantage (for example performance-wise) for configuring Fish login shells with commands like set -x EDITOR nano
set -x VISUAL nano
set -x PAGER less that are executed every time a login shell occurs instead of running set -U EDITOR nano
set -U VISUAL nano
set -U PAGER less once? Why do I want to do it like this? It is more similar to how things work in Bash and Zsh and it fits better into my Ansible Playbooks I use to manage my environments. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
These aren't the same thing.
That being said:
No. It's fine. Setting a variable is quite fast. If you did have a performance problem you could measure it (for example with |
Beta Was this translation helpful? Give feedback.
These aren't the same thing.
set -x EDITOR nano
creates a variable and marks it to be exported. That means it will be passed to external processes, so if you dogit commit
it will know your $EDITOR and will runnano
to edit your commit message. In this case, because your variable doesn't already exist, it will be made global. It's good practice to spell this out likeset -gx EDITOR nano
and make it global and exported explicitly.set -U EDITOR nano
makes a universal variable $EDITOR and sets it to nano. It won't be exported unless it's set to be exported somewhere else. And exported universal variables can sometimes be annoyingly sticky, see https://fishshell.com/docs/current/faq.html#why…