commit - cc48e73a96c863784fb0bc46e69bccf509890827
commit + fa7fecff33769e27653a51d1d15909d2b538194b
blob - e0f7c8f93b7c8b02619f7e23ac91f66593bbc30a
blob + f52480fd1e9291c42207702fcf15157e57dc6a3d
--- bin/quote1
+++ bin/quote1
. 9.rc
-fn text {
- if(~ $winid [0-9]*)
- 9p read acme/$winid/body
- if not if(~ $text9term unix!*)
- dial -e $text9term </dev/null
- if not
- status=''
-}
-
PROMPT='[^ ]*[%;$#][ ]+'
fn cmds {
- text | sed -n 's/^'$PROMPT'([^"])/ \1/p'
+ wintext | sed -n 's/^'$PROMPT'([^"])/ \1/p'
}
switch($#*) {
blob - c77da34daaef311a89b61b19bffe5820f7461752
blob + e31e3de18f584d46e1b0434e84813b78ac396c46
--- bin/quote2
+++ bin/quote2
#!/usr/local/plan9/bin/rc
-cmd = `{" $* | tail -1}
+cmd = `{quote1 $* | tail -1}
if (~ $#cmd 0) {
echo no such command found >[1=2]
exit notfound
blob - 93fe40ea4fe574e61135996805474bf0b16cc785
blob + 80a89957631ab8aba3cf5daf51df300dcbd32504
--- bin/wintext
+++ bin/wintext
-#!/bin/sh
+#!/bin/bash
case "$winid" in
[0-9]*)
exit 0
esac
+case "$TMUX" in
+?*)
+ tmux capture-pane -p
+ exit 0
+esac
+
echo 'no running window found' 2>&1
exit 1
blob - 12859f259445edab0c27ff6f07acf7aaf09b67c3
blob + 966b307b48a65ccfba3dae8b28e42d0b645b6e03
--- man/man1/wintext.1
+++ man/man1/wintext.1
wintext, ", "" \- access text in current window
.ds x \C'"'
.ds xx \C'"'\^\^\^\^\C'"'
-.ds y \*x\
-.ds yy \*(xx\
+.ds y \*x\^
+.ds yy \*(xx\^
.SH SYNOPSIS
.B wintext
.br
-.B \*x\
+.B \*y
[
.I prefix
]
.br
-.B \*(xx\
+.B \*(yy
[
.I prefix
]
prints the text of the current
.I win
(see
-.IR acme (1))
+.IR acme (1)),
+.IR 9term (1),
or
-.IR 9term (1)
+(Unix's)
+.IR tmux (1)
window to standard output.
.PP
.I \*y
.I \*(yy
prints the last command that
.I \*y
-would print and then executes it by piping it into
+would print and then executes it by piping it into
.IR rc (1).
.PP
Both
% \*(xx lc
% lc r*
ramfs rc read rio rm
-%
+%
.EE
.SH SEE ALSO
.IR 9term (1),