2 # window [many options] cmd [arg...] - create new window and run cmd in it
6 echo 'window: $wsys not defined'
11 # original version used mount to do the work
15 echo usage: window '''minx miny maxx maxy''' cmd args ...
26 if(x=`{cat /dev/ppid}; mount $srv $dir N`{{echo $x $1 }| sed 's/^ //g;s/ +/,/g'}){
29 echo -n `{basename $1} > /dev/label >[2] /dev/null
30 exec $* < /dev/cons > /dev/cons >[2] /dev/cons
35 # if argument is of form '100 100 200 200' or '100,100,200,200' use old way
36 if(~ $1 *[0-9][' ,'][0-9]*){
41 # geometry parameters are:
49 # where n can be a number, to set the value, or +number or -number to change it
54 if(test -f /dev/wctl) echo /dev/wctl
55 if not if(test -f /mnt/term/dev/wctl) echo /mnt/term/dev/wctl
56 if not if(~ $service cpu) echo /mnt/term/srv/riowctl.*.*
58 echo window: '$wctl' not defined >[1=2]
65 # use mount to make local window
75 unmount /mnt/acme /dev >[2]/dev/null
76 if(mount $srv $dir 'new -pid '^`{cat /dev/ppid}^' '$"*){
78 # toss geometry parameters to find command
81 case -dx -dy -minx -miny -maxx -maxy
94 echo -n `{basename $cmd(1)} > /dev/label >[2] /dev/null
95 exec $cmd < /dev/cons > /dev/cons >[2] /dev/cons
100 if not echo new -cd `{pwd} $* >> `{getwctl}