Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Even more about my nvi/zsh-bug




I am talking about this bug. If nvi is started under screen, it says
this:

/home/juhtolv/.nexrc, 9: Shell expansion failed
/home/juhtolv/.nexrc, 9: Ex command failed: pending commands discarded
Press Enter to continue: 

Here is that line number 9 and comments for it:

" If ~/.nexrc exists, ~/.exrc is not read. So it must be sourced here:
so ~/.exrc

Under screen, this works fine:

SHELL=/bin/sh nvi

But plain nvi command makes that bug appear. But this is strange: I can
use any shell in that environment variable SHELL and nvi still works
fine. Even /bin/zsh is good for it. But look at this:

% echo $SHELL
zsh

As you can see, it says just "zsh", not "bin/zsh". Both these commands
make bug appear:

SHELL=sh nvi
SHELL=zsh nvi

Now, let's see some relevant parts from my ~/.screenrc :

shell -zsh

That means that whenever I hit "Ctrl-a c", it starts zsh and as
login-shell. But as you can see, path is not there, just zsh. And then:

#####################
# Automatic stuff:
#

screen -M -t ROOT 1 su -c 'zsh -l'
screen -M -t ROOT 2 su -c 'zsh -l'

# NICE HACK: Do not start those heavy zsh-shells immediately.
screen    -t zsh   3 ash -c 'fortune 100% debian-hints ; sleep 120 ; exec zsh -l'
screen    -t zsh   4 ash -c 'fortune 100% go ; sleep 180 ; exec zsh -l'
screen    -t zsh   5 ash -c 'sleep 240 ; fortune 100% np-fortune ; exec zsh -l'
screen    -t zsh   6 ash -c 'sleep 300 ; fortune 20% myfortune 80% twisted-quotes ; exec zsh -l'
screen    -t zsh   7 ash -c 'sleep 360 ; exec zsh -l'

screen    -t  zsh 8  ash -c '/home/juhtolv/bin/crm114-handlespamA.sh ; fortune 100% osfortune ; exec zsh -l'

select 1

And as you can see, zsh is there in many places without path. If I
replace every occurrence of "zsh" in that .screenrc with "/bin/zsh", nvi
works just fine under screen. Case closed!

Summa summarum: nvi checks environment variable $SHELL . It tries to use
shell mentioned in that variable, but that environment variable must
have whole path of that shell. I am not very sure, if nvi must be fixed.
Normally $SHELL is defined so that it has whole path of shell, not just
command. I guess Unix-standards like POSIX demand it to be so.

But it might be good idea to add some information about these problems
to its FAQ. I hereby declare this E-Mail message you are reading to be
public domain.


-- 
Juhapekka "naula" Tolvanen * * http colon slash slash iki dot fi slash juhtolv
"kummaan paikkaan itsesi karkotit, syyttä syyllisten seuduille. raskaisiin
taloihin pesit, kirkuviin huoneisiin. mitä ne sinulle tekevät siellä? kuka on
raapinut nimesi pois, nimesi, kasvosi, mielesi oivat palvelemaan konetta?" CMX



Messages sorted by: Reverse Date, Date, Thread, Author