mirror of
https://github.com/tmux/tmux.git
synced 2026-10-09 11:44:23 +00:00
Add pipe-selection copy mode command
This commit is contained in:
@@ -37,6 +37,13 @@ $TMUX send-keys -X copy-selection || exit 1
|
|||||||
[ "$($TMUX show-buffer)" = unfinished ] || exit 1
|
[ "$($TMUX show-buffer)" = unfinished ] || exit 1
|
||||||
$TMUX send-keys -X cancel || exit 1
|
$TMUX send-keys -X cancel || exit 1
|
||||||
|
|
||||||
|
$TMUX copy-mode || exit 1
|
||||||
|
$TMUX send-keys -X select-output || exit 1
|
||||||
|
$TMUX send-keys -X pipe-selection "wc -c >$OUT" || exit 1
|
||||||
|
sleep 1
|
||||||
|
[ "$(cat "$OUT")" = 10 ] || exit 1
|
||||||
|
$TMUX send-keys -X cancel || exit 1
|
||||||
|
|
||||||
$TMUX copy-mode || exit 1
|
$TMUX copy-mode || exit 1
|
||||||
$TMUX send-keys -X search-backward separator || exit 1
|
$TMUX send-keys -X search-backward separator || exit 1
|
||||||
$TMUX send-keys -X copy-output || exit 1
|
$TMUX send-keys -X copy-output || exit 1
|
||||||
|
|||||||
7
tmux.1
7
tmux.1
@@ -2324,6 +2324,13 @@ Pipe the current OSC 133 command output to
|
|||||||
.Ar command
|
.Ar command
|
||||||
and clear the selection.
|
and clear the selection.
|
||||||
.It Xo
|
.It Xo
|
||||||
|
.Ic pipe\-selection
|
||||||
|
.Op Ar command
|
||||||
|
.Xc
|
||||||
|
Pipe the selected text to
|
||||||
|
.Ar command
|
||||||
|
and clear the selection.
|
||||||
|
.It Xo
|
||||||
.Ic previous\-matching\-bracket
|
.Ic previous\-matching\-bracket
|
||||||
(emacs: M\-C\-b)
|
(emacs: M\-C\-b)
|
||||||
.Xc
|
.Xc
|
||||||
|
|||||||
@@ -3917,6 +3917,12 @@ static const struct {
|
|||||||
.clear = WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
.clear = WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
||||||
.f = window_copy_cmd_pipe_output
|
.f = window_copy_cmd_pipe_output
|
||||||
},
|
},
|
||||||
|
{ .command = "pipe-selection",
|
||||||
|
.args = { "", 0, 1, NULL },
|
||||||
|
.flags = 0,
|
||||||
|
.clear = WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
||||||
|
.f = window_copy_cmd_pipe
|
||||||
|
},
|
||||||
{ .command = "previous-matching-bracket",
|
{ .command = "previous-matching-bracket",
|
||||||
.args = { "", 0, 0, NULL },
|
.args = { "", 0, 0, NULL },
|
||||||
.flags = WINDOW_COPY_CMD_FLAG_READONLY,
|
.flags = WINDOW_COPY_CMD_FLAG_READONLY,
|
||||||
|
|||||||
Reference in New Issue
Block a user