You are not logged in.
I'm not quite sure what I've done wrong here, but the EDITOR and VISUAL environment variables are being ignored and I have no idea why. I feel like this was working fine, but as far as I'm aware I haven't changed anything.
% printf 'EDITOR: %s\nVISUAL: %s\nSUDO: %s\nGIT: %s\n' $EDITOR $VISUAL $SUDO_EDITOR $GIT_EDITOR
EDITOR: /usr/bin/nvim
VISUAL: /usr/bin/nvim
SUDO:
GIT:
% sudoedit /etc/pacman.conf
sudoedit: /usr/bin/vi: command not found
% git --git-dir="$HOME/.config/dotfiles" --work-tree="$HOME" commit
hint: Waiting for your editor to close the file... error: cannot run vi: No such file or directory
error: unable to start editor 'vi'
Please supply the message using either -m or -F optionAs far as I can tell, both git and sudoedit should be using the VISUAL or EDITOR environment variable if they are set and SUDO_EDITOR or GIT_EDITOR are not.
Last edited by dtjohnst (2023-07-09 21:28:09)
Offline
printenv | grep viOffline
Nothing returned.
Edit: That doesn't seem right though, does it? Shouldn't both EDITOR and VISUAL be returned as 'vi' is in 'nvim'?
Last edited by dtjohnst (2023-07-09 07:15:58)
Offline
Yup.
The variables are either not exported or something™ clears the environment on any execv…
export EDITOR=foo
export foo=bar
printenv | grep foo
export EDITOR=nvim
export VISUAL=nvim
printenv | grep nvim
sudoedit /etc/pacman.confOffline
I'm not quite sure why, but it seems set -a wasn't quite working right. My understanding is that it should enable all defined variables to be exported. For example:
% SOMEVAR="hi"
% printenv SOMEVAR
% set -a
% SOMEVAR="hi"
% printenv SOMEVAR
hiThis works as I expected. But my .zshenv file was as follows:
% cat .zshenv
set -a
LS_COLORS='no=00:rs=0:fi=00:di=01;<cut for space>:';
ZLSCOLORS="${LS_COLORS}"
DIFFPROG="/usr/bin/nvim -d"
EDITOR="/usr/bin/nvim"
LESS=eFRX
LESSHISTFILE=-
PAGER="/usr/bin/less"
VISUAL="/usr/bin/nvim"
set +aAnd that didn't work. Removing the set commands and prefixing all the variables with export works correctly though. I'm not quite sure why set wasn't working and would appreciate some enlightenment if anyone knows, but at least things are working now.
Offline
Does "un/setopt allexport" (still) work?
Offline