groff 1.23.0 added .MR to its -man macro package. The NEWS file states
that the inclusion of the macro "was prompted by its introduction to
Plan 9 from User Space's troff in August 2020." From d32deab it seems
that the name for Plan 9 from User Space's implementation was suggested
by groff maintainer G. Brandon Robinson.
Not sure if the intention was to make these definitions compatible, but
it would be nice if they were.
Currently, Plan 9 from User Space's .MR expects its second argument to
be parenthesized. groff's .MR does not. This results in extra
parentheses appearing in manual references when viewing Plan 9 from User
Space's manual pages on a system using groff.
101 lines
1.4 KiB
Groff
101 lines
1.4 KiB
Groff
.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!
|