You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The question of how to set environment exports for a single command line came up twice today in the IRC channel, and in multiple issues submitted here lately. It's a common gotcha.
Currently if you try the bash syntax, you get a nice error except it's not too relevant:
> EDITOR=vim git commit
fish: Unknown command “EDITOR=vim”. Did you mean “set EDITOR vim”? For
information on assigning values to variables, see the help section on the set
command by typing “help set”.
Perhaps fish could detect if there was any tokens following the environment assignment (ie. a command) and in that case instead print an error message suggesting env EDITOR=vim git commit. If this is hard to get right, perhaps the error above could simply be changed to mention both possibilities.
The question of how to set environment exports for a single command line came up twice today in the IRC channel, and in multiple issues submitted here lately. It's a common gotcha.
Currently if you try the bash syntax, you get a nice error except it's not too relevant:
Perhaps fish could detect if there was any tokens following the environment assignment (ie. a command) and in that case instead print an error message suggesting
env EDITOR=vim git commit
. If this is hard to get right, perhaps the error above could simply be changed to mention both possibilities.Cf. #587, #438 etc.
The text was updated successfully, but these errors were encountered: