scratch my previous explanation. it is incorrect. looking through
rio's source code it appears that the cause is the supplied "rc -c"
argument to 'window'. the window command assumes that everything after
the switches is a command to be executed and actually prepends 'rc -c'
in front of your command line. due to quoting and other mishaps, the
end effect is that the command as specified (i'm testing with "sleep"
instead of "tail -f") is executed as:

rc -c 'rc -c label test; sleep 20' (quoting as per the rio window manager)

instead, you should probably just do:

window 'label test; sleep 20', which will be executed as:

rc -c 'label test; sleep 20'

and will work fine even without the -m switch.

you can see for yourself the described behaviour via the following
test on a plain shell (all execute commands to be run without the
double quotes):

1: execute "rc -c 'label test; sleep 20'"
2: hide the window (you'll see the label 'test')
3: unhide the window and terminate the sleep
4: execute "rc -c 'rc -c label test; sleep 20'"
5: hide the window (you'll see an empty entry for the window label)
6: unhide the window. notice that the label remains empty even after
the sleep has completed

finally, try a fully escaped shell to see that it works:
7: execute "rc -c 'rc -c ''label test; sleep 20'''"
8: hide the window

why rc behaves this way is a different matter altogether. i'll leave
it to you, but i encourage you to dig in the source. i figured all
this out after editing the rio source and adding a piece of code to
print me the argument list it executes for a new window. i doubt
you'll ever find an easier source to deal with than on plan9. rio is
only 5K lines of code and acme makes navigation through that code a
bliss. same goes for almost everything else in the system.

Reply via email to