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