From: igor@9lab.org
To: 9front@9front.org
Subject: Re: [9front] [PATCH] rio: allow spaces in working directory path (-cd) when creating a new window
Date: Thu, 25 Nov 2021 11:40:56 +0100 [thread overview]
Message-ID: <7CEF83159FC92104223B8FEC4E0A594B@9lab.org> (raw)
In-Reply-To: <B884909AAC83761D18BC037BEB08577E@felloff.net>
Thanks for looking over it!
Quoth cinap_lenrek@felloff.net:
[…]
> probably is better to parse everything using gettokens().
> as your patch doesnt handle quoting the quotes.
[…]
Thanks for the tip. That indeed sounds like the cleaner solution.
> the whole window command also will probably have issues with
> this kind of stuff... the quoting is definitely messed up in
> there.
Yeah, that is where my journey started, thinking that window cmd
was the culprit, until I realised that the limitation goes all
the way to `/sys/src/cmd/rio/wctl.c:/^parsewctl`.
>
> tho it is possible to quote from rc, like:
>
> fn q {a=$1 whatis a | sed 's!^a=!!;q'}
>
> or even get rid of wctl all together... it is a bit silly given
> you can just fork and mount $wsys yourself... then there are not
> two different code paths for creating a window.
I think I understand what you mean. The below is just checking I am
on the same page.
You are referring to the two highlighted ('^^^') code paths in
/rc/bin/window:
…
if(~ $#mflag 1) {
^^^
…
if(mount $wsys /mnt/wsys 'new '$"spec){
bind -b /mnt/wsys /dev
exec $argv0 -x $cmd </dev/cons >/dev/cons >[2]/dev/cons
}
}&
exit ''
}
if not {
^^^ if(~ $wctl ''){
if(test -f /dev/wctl) wctl=/dev/wctl
if not if(test -f /mnt/term/dev/wctl) wctl=/mnt/term/dev/wctl
if not if(test -r /mnt/term/env/wctl) wctl=/mnt/term^`{cat /mnt/term/env/wctl}
if not {
echo $argv0: '$wctl' not defined >[1=2]
exit bad
}
}
if(! ~ $#wdir 0)
spec=($spec -cd $wdir)
echo new $spec $argv0 -x $cmd >>$wctl
}
…
…if I understand you correctly the suggestion is to drop the `if not { … }`
part that writes to $wctl and modify the `if(~ $#mflag 1) { … }` in
such a way that it can handle both the `-m` and non `-m` variant.
Cheers,
Igor
next prev parent reply other threads:[~2021-11-25 11:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 2:17 igor
2021-11-25 9:57 ` cinap_lenrek
2021-11-25 10:40 ` igor [this message]
2021-11-29 0:29 ` igor
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=7CEF83159FC92104223B8FEC4E0A594B@9lab.org \
--to=igor@9lab.org \
--cc=9front@9front.org \
/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).