wmcharon 447 B

12345678910111213141516171819202122232425262728
  1. # /dis/sh script
  2. # wm defines "menu" and "delmenu" builtins
  3. load std
  4. prompt='% ' ''
  5. fn % {$*}
  6. autoload=std
  7. home=/usr/^"{cat /dev/user}
  8. if {! {~ wm ${loaded}}} {
  9. echo wmsetup must run under wm >[1=2]
  10. raise usage
  11. }
  12. fn wmrun {
  13. args := $*
  14. {
  15. pctl newpgrp
  16. fn wmrun
  17. $args
  18. } > /chan/wmstdout >[2] /chan/wmstderr &
  19. }
  20. fn cd {
  21. builtin cd $*; echo cwd `{pwd} > /chan/shctl >[2] /dev/null
  22. }
  23. plumber >[2] /chan/wmstderr >/chan/wmstdout
  24. wmrun $*