Skip to content

Commit

Permalink
mail: more reliably find vi command (#823)
Browse files Browse the repository at this point in the history
* On Android I have Termux, and vi is installed as /data/data/com.termux/files/usr/bin/vi
* Remove the assumption that vi is installed under /usr/bin
* With this patch, perl will look for vi within $PATH
* Tested on OpenBSD and Termux/Android
* Environment variable $VISUAL still takes precedence if it is set
  • Loading branch information
mknos authored Nov 19, 2024
1 parent 547845d commit 4427b73
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bin/mail
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,7 @@ sub listing {
}
sub vipath {
return $ENV{'VISUAL'} if (defined $ENV{'VISUAL'});
my $default = '/usr/bin/vi';
return $default if (-x $default);
warn "No VISUAL in environment\n";
return;
return 'vi';
}
sub shell {
# How to get an interactive shell in Perl. Hmmm...
Expand Down

0 comments on commit 4427b73

Please sign in to comment.