rsc | 0a61c07 | 2004-04-19 18:18:37 +0000 | [diff] [blame] | 1 | #!/bin/rc |
| 2 | switch($#*){ |
| 3 | case 0 1 2 |
| 4 | echo usage: window '''minx miny maxx maxy''' '''minx miny maxx maxy''' cmd args ... |
| 5 | exit usage |
| 6 | } |
| 7 | |
| 8 | rfork ns |
| 9 | |
| 10 | if(mount $wsys /mnt/acid N`{{echo $pid $1 }| sed 's/^ //g;s/ +/,/g'}){ |
| 11 | winid=`{cat /dev/winid} |
| 12 | echo transcript > /mnt/acid/label |
| 13 | echo transcript > /mnt/acid/cons |
| 14 | shift |
| 15 | } |
| 16 | if not exit 0 |
| 17 | |
| 18 | if(mount $wsys /mnt/wsys N`{{echo $pid $1 }| sed 's/^ //g;s/ +/,/g'}){ |
| 19 | shift |
| 20 | bind -b /mnt/wsys /dev |
| 21 | } |
| 22 | if not exit 0 |
| 23 | |
| 24 | echo -n `{basename $1} > /dev/label >[2] /dev/null |
| 25 | @{ |
| 26 | echo hang > /proc/^`{cat /dev/ppid}^/ctl |
| 27 | $* < /dev/$winid/cons > /dev/$winid/cons >[2] /dev/$winid/cons & |
| 28 | exit $apid |
| 29 | } |
| 30 | ostatus = `{echo $status | sed 's/.*://'} |
| 31 | echo waitstop > /proc/$ostatus/ctl |
| 32 | echo nohang > /proc/$ostatus/ctl |
| 33 | exit $ostatus |