transcript 752 B

123456789101112131415161718192021222324252627282930313233
  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. rfork ns
  8. if(mount $wsys /mnt/acid N`{{echo $pid $1 }| sed 's/^ //g;s/ +/,/g'}){
  9. winid=`{cat /dev/winid}
  10. echo transcript > /mnt/acid/label
  11. echo transcript > /mnt/acid/cons
  12. shift
  13. }
  14. if not exit 0
  15. if(mount $wsys /mnt/wsys N`{{echo $pid $1 }| sed 's/^ //g;s/ +/,/g'}){
  16. shift
  17. bind -b /mnt/wsys /dev
  18. }
  19. if not exit 0
  20. echo -n `{basename $1} > /dev/label >[2] /dev/null
  21. @{
  22. echo hang > /proc/^`{cat /dev/ppid}^/ctl
  23. $* < /dev/$winid/cons > /dev/$winid/cons >[2] /dev/$winid/cons &
  24. exit $apid
  25. }
  26. ostatus = `{echo $status | sed 's/.*://'}
  27. echo waitstop > /proc/$ostatus/ctl
  28. echo nohang > /proc/$ostatus/ctl
  29. exit $ostatus