aboutsummaryrefslogtreecommitdiff
path: root/man/man1/wintext.1
blob: b7108e46210371822431f89242ab45ac8fea0802 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.TH WINTEXT 1
.SH NAME
wintext, ", "" \- access text in current window
.ds x \C'"'
.ds xx \C'"'\^\^\^\^\C'"'
.ds y \*x\^
.ds yy \*(xx\^
.SH SYNOPSIS
.B wintext
.br
.B \*y
[
.I prefix
]
.br
.B \*(yy
[
.I prefix
]
.SH DESCRIPTION
.I Wintext
prints the text of the current
.I win
(see
.MR acme (1) ),
.MR 9term (1) ,
or
(Unix's)
.MR tmux (1)
window to standard output.
.PP
.I \*y
searches the window text for commands typed with a particular prefix
and prints them, indented, to standard output.
.I Prefix
is a regular expression that is matched against the beginning of the command-line.
If
.I prefix
is omitted,
.I \*y
prints the last command executed.
.I \*(yy
prints the last command that
.I \*y
would print and then executes it by piping it into
.MR rc (1) .
.PP
Both
.I \*y
and
.I \*(yy
identify commands in the window text by looking for lines
beginning with a shell prompt.
Prompts are assumed to be an unindented sequence of
non-whitespace characters followed by one of the
characters
.BR % ,
.BR ; ,
.BR $ ,
or
.BR # .
.SH EXAMPLES
Print the
.MR ls (1)
and
.I lc
commands executed in this window:
.IP
.EX
.ta +4n
% \*x 'l[sc]'
	% ls -l /tmp/qq*
	# ls -lrt /etc
	% lc r*
%
.EE
.PP
Execute the most recent
.I lc
command again:
.IP
.EX
.ta +4n
% \*(xx lc
	% lc r*
ramfs   rc      read    rio     rm
%
.EE
.SH SEE ALSO
.MR 9term (1) ,
.MR acme (1)
.SH SOURCE
.B \*9/bin
.SH BUGS
.I \*y
and
.I \*(yy
are hard to type in shells other than
.MR rc (1) .
.\" and in troff!