9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Rudolf Sykora" <rudolf.sykora@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net>
Subject: Re: [9fans] window -hide rc -c 'label a_name; tail -f some_file'
Date: Thu,  9 Oct 2008 09:31:31 +0200	[thread overview]
Message-ID: <a560a5d00810090031n3187179dgc74e8df66818f684@mail.gmail.com> (raw)
In-Reply-To: <14ec7b180810081340q33691c83sd6403767202aa64a@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2249 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2805 bytes --]

      reply	other threads:[~2008-10-09  7:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-08 18:26 Rudolf Sykora
2008-10-08 18:42 ` Pietro Gagliardi
2008-10-08 19:01   ` Rudolf Sykora
2008-10-08 18:43 ` andrey mirtchovski
2008-10-08 19:11   ` Rudolf Sykora
2008-10-08 20:40     ` andrey mirtchovski
2008-10-09  7:31       ` Rudolf Sykora [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a560a5d00810090031n3187179dgc74e8df66818f684@mail.gmail.com \
    --to=rudolf.sykora@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).