From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Thu, 9 Oct 2008 09:31:31 +0200 From: "Rudolf Sykora" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> In-Reply-To: <14ec7b180810081340q33691c83sd6403767202aa64a@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_71918_23772834.1223537491925" References: <14ec7b180810081143v32a355fdpd75ca5f53b6b4dbe@mail.gmail.com> <14ec7b180810081340q33691c83sd6403767202aa64a@mail.gmail.com> Subject: Re: [9fans] window -hide rc -c 'label a_name; tail -f some_file' Topicbox-Message-UUID: 1a48e080-ead4-11e9-9d60-3106f5b1d025 ------=_Part_71918_23772834.1223537491925 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 2008/10/8 andrey mirtchovski > 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. > > Thanks a lot. I probably just wouldn't be able to find that :) I'll try and go through the code myself. Just one last question concerning this. Is it the right, expected behaviour of the window command, or should the original version work and sth. should be changed? Ruda ------=_Part_71918_23772834.1223537491925 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline


2008/10/8 andrey mirtchovski <mirtchovski@gmail.com>
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.

Thanks a lot. I probably just wouldn't be able to find that :) I'll try and go through the code myself.
Just one last question concerning this. Is it the right, expected behaviour of the window command, or should the original version work and sth. should be changed?
Ruda
------=_Part_71918_23772834.1223537491925--