diff options
author | Igor Böhm <igor@9lab.org> | 2021-11-29 00:06:45 +0000 |
---|---|---|
committer | Igor Böhm <igor@9lab.org> | 2021-11-29 00:06:45 +0000 |
commit | 614f1d6268fd986fc628eec3754bd4599363ad13 (patch) | |
tree | 0468672e3476e511a7b585f4f47f39cbae5f48bc /rc/bin/window | |
parent | 5d69d42ee3ac87861b7cf8767cc7755c173e6c2c (diff) |
rio: allow spaces in working directory path (-cd) when creating a new window via wctl
The initial working directory of a new window may be set by a
`-cd directory` option. However, the `-cd directory` option is
not capable of handling paths with spaces when used via wctl.
To enable paths with spaces the function
/sys/src/cmd/rio/wctl.c:/^parsewctl is extended to handle quoted
directory paths.
Before applying the patch the following will fail to open a new
window by writing to /dev/wctl:
<snip>
% rio -i window
% mkdir '/tmp/path with space'
% echo new -cd '''/tmp/path with space''' window -x rc >> /dev/wctl
% pwd
/tmp/path with space
<snap>
The following invocation fails as well:
<snip>
% window -cd '/tmp/path with space'
% pwd
/tmp/path with space
<snap>
After applying the patch the above sequences work as expected,
opening a window running rc with the working directory set to
'/tmp/path with space'.
Diffstat (limited to 'rc/bin/window')
-rwxr-xr-x | rc/bin/window | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rc/bin/window b/rc/bin/window index 06022a127..6f2c5003b 100755 --- a/rc/bin/window +++ b/rc/bin/window @@ -100,6 +100,6 @@ if not { } if(! ~ $#wdir 0) - spec=($spec -cd $wdir) + spec=($spec -cd `{a=$wdir whatis a|sed 's!^a=!!;q'}) echo new $spec $argv0 -x $cmd >>$wctl } |