Open sqrt36 opened 7 years ago
The problem lies with how the shell interprets the $EDITOR
variable. When you run which
on the aliases before the zource
, it shows the variable as empty.
root@vance-origin [09:31:48 PM] [~]
-> # which zcustom
zcustom=' /root/.oh-my-zsh/custom/plugins/custom/custom.plugin.zsh'
After the zource
:
root@vance-origin [09:32:07 PM] [~]
-> # zource; which zcustom
zcustom='vim /root/.oh-my-zsh/custom/plugins/custom/custom.plugin.zsh'
/usr/bin/vim
However, if you echo the value of the $EDITOR
variable, before the zource
, you can see that it is assigned.
root@vance-origin [09:37:48 PM] [~]
-> # echo
vim
Description
Immediately after logging in, if you try to edit a config file with its alias, such as
vimrc
orzcustom
, you get a permission denied error.This does not happen when editing the file directly or with the
zshrc
command.File permissions
Workaround
When the zshrc is re-sourced, the error no longer occurs.
Alternatively, when you start tmux or log into a new zsh, the zshrc is sourced, so the error does not occur.