-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment Variable $EDITOR
Not Being Properly Resolved
#2261
Comments
I have been diving into the code to understand how it works. I noticed that there might be an opportunity to use the shellexpand crate to handle environment variable expansion. Specifically, I think it could be useful around line 293 in yazi-scheduler/src/scheduler.rs. |
What does |
like this sh -c 'echo $EDITOR'
lvim |
My .zshrc file is configured as follows: alias lvim='NVIM_APPNAME="nvim-lazyvim" nvim'
alias vim='lvim'
alias v='lvim'
export EDITOR='lvim' |
This is a bit strange. Yazi relies on yazi/yazi-scheduler/src/process/shell.rs Lines 31 to 46 in b6cb1fa
I don't think this needs to be handled separately in Yazi, because that would mean we'd have to write a shell parser ourselves and deal with all sorts of edge cases, like nested shells. For example, in |
Thank you for pointing out the specific execution location. I now have a starting point for troubleshooting, and I will try some other configurations to confirm the actual issue. |
I have identified two primary issues
A viable workaround involves exporting the variables separately: export NVIM_APPNAME="nvim-lazyvim"
export EDITOR="nvim" This approach works correctly. Another attempted solution involved using eval to execute $EDITOR from within the source code. However, I am concerned about whether this method might introduce security risks. Additionally, my initial implementation ( |
What system are you running Yazi on?
macOS
What terminal are you running Yazi in?
wezterm 20240203-110809-5046fc22
yazi --debug
outputDescribe the bug
When using Yazi's batch rename feature with
$EDITOR
environment variable in the configuration, it fails with exit code 127 without meaningful error messages in the log. However, explicitly specifying the full command works as expected.Minimal reproducer
Anything else?
No response
Checklist
yazi --debug
) input box to the nightly that I triedmv ~/.config/yazi ~/.config/yazi-backup
)The text was updated successfully, but these errors were encountered: