On Tue, Sep 15, 2026 at 11:33:56PM +0200 Oliver M. Schode wrote:
[...]
> I'm aware this reads like #894665 but as I understand that one was about
> "recursive" assignments in EDITOR. Not sure if there was ever an attempt
> to fix this which somehow didn't work, yet I just realized vidir stopped
> bothering about EDITOR at all. Strangely though it still tracks VISUAL.
> However, unsetting VISUAL and changing EDITOR at the same crashes right
> away: "exited nonzero, aborting". That message is similar to one
> mentioned in the other report, so maybe a related issue.

Are you sure about the "unsetting" part?  Or did you set VISUAL to an 
empty value?

With unset VISUAL, vidir works for me as expected:

$ touch spam.txt
$ unset VISUAL
$ EDITOR='sed -i -e s,spam,eggs,' vidir
$ find . -maxdepth 1 -name '*.txt'
./eggs.txt


But I _do_ see a bad behaviour, if EDITOR or VISUAL are defined but empty:

$ VISUAL= EDITOR=vim vidir
 exited nonzero, aborting
[exit code 13]


Adding a simple check against empty EDITOR/VISUAL helps here:

diff --git a/vidir b/vidir
index 4a1f5f2ceedd..a88f7a8cdeaa 100755
--- a/vidir
+++ b/vidir
@@ -132,10 +132,10 @@ my @editor="vi";
 if (-x "/usr/bin/editor") {
        @editor="/usr/bin/editor";
 }
-if (exists $ENV{EDITOR}) {
+if (exists $ENV{EDITOR} and $ENV{EDITOR}) {
        @editor=split(' ', $ENV{EDITOR});
 }
-if (exists $ENV{VISUAL}) {
+if (exists $ENV{VISUAL} and $ENV{VISUAL}) {
        @editor=split(' ', $ENV{VISUAL});
 }
 $ret=system(@editor, $tmp);



Does that solve your problem?

Kind regards,
Nicolas

Reply via email to