rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 1 | .TH LABEL 1 |
| 2 | .SH NAME |
| 3 | label, awd \- set window label |
| 4 | .SH SYNOPSIS |
| 5 | .B label |
| 6 | .I string |
| 7 | .br |
| 8 | .B awd |
rsc | efe1241 | 2005-01-30 16:27:45 +0000 | [diff] [blame] | 9 | [ |
| 10 | .I sysname |
| 11 | ] |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 12 | .SH DESCRIPTION |
| 13 | .I Label |
| 14 | sets the label of the current |
| 15 | .I win |
| 16 | (see |
| 17 | .IR acme (1)) |
| 18 | or X terminal window |
| 19 | .RI ( e.g., |
| 20 | .IR 9term (1) |
| 21 | or |
| 22 | .IR xterm (1)) |
| 23 | by echoing a special control sequence to standard output. |
| 24 | .PP |
| 25 | .I Acme |
| 26 | and |
| 27 | .I 9term |
| 28 | windows assume the label is a directory name. |
| 29 | When unrooted file names are plumbed in the window, |
| 30 | they are evaluated relative to the directory named in the label. |
rsc | efe1241 | 2005-01-30 16:27:45 +0000 | [diff] [blame] | 31 | .PP |
| 32 | The label may have a suffix |
rsc | d747e54 | 2006-03-12 16:39:29 +0000 | [diff] [blame] | 33 | .BI /- sysname \fR, |
rsc | efe1241 | 2005-01-30 16:27:45 +0000 | [diff] [blame] | 34 | which is not interpreted as part of the directory during plumbing. |
| 35 | .I Awd |
| 36 | sets the window name to the current directory with a |
| 37 | .BI /- sysname |
| 38 | suffix, using the name of the current system by default. |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 39 | .SH EXAMPLE |
| 40 | One can use the following |
| 41 | .IR sh (1) |
| 42 | function to keep the label up-to-date in response to |
| 43 | .I cd |
| 44 | commands: |
| 45 | .IP |
| 46 | .EX |
| 47 | _cd () { |
| 48 | \ecd "$@" && |
| 49 | case $- in |
| 50 | *i*) |
| 51 | awd |
| 52 | esac |
| 53 | } |
| 54 | alias cd=_cd |
| 55 | cd . |
| 56 | .EE |
| 57 | .PP |
| 58 | .IR Rc (1) |
| 59 | installs a similar |
| 60 | .B fn |
| 61 | .B cd |
| 62 | at startup if there is not already a function named |
| 63 | .BR cd : |
| 64 | .IP |
| 65 | .EX |
| 66 | fn cd { |
rsc | 7b14c11 | 2005-08-11 17:06:25 +0000 | [diff] [blame] | 67 | if(builtin cd $1){ |
| 68 | if(flag i) $PLAN9/bin/9 awd || status='' |
| 69 | status='' |
| 70 | } |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 71 | } |
| 72 | .EE |
| 73 | .SH SOURCE |
rsc | c3674de | 2005-01-11 17:37:33 +0000 | [diff] [blame] | 74 | .B \*9/bin/label |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 75 | .br |
rsc | c3674de | 2005-01-11 17:37:33 +0000 | [diff] [blame] | 76 | .B \*9/bin/awd |
rsc | 058b011 | 2005-01-03 06:40:20 +0000 | [diff] [blame] | 77 | .SH BUGS |
| 78 | .I Awd |
| 79 | is also documented in |
| 80 | .IR acme (1). |