Add a get-clipboard option which when enabled (the default is off) uses

the same mechanism as palette requests to request clipboard from the
terminal and forward to the requesting pane. Remove the now-redundant
forward-to-pane ability from "refresh-client -l". GitHub issue 4275.
This commit is contained in:
nicm
2025-12-02 08:20:32 +00:00
parent e4c552f5a5
commit 322adfbdde
7 changed files with 158 additions and 93 deletions

35
tmux.1
View File

@@ -1361,12 +1361,11 @@ and sets an environment variable for the newly created session; it may be
specified multiple times.
.Tg refresh
.It Xo Ic refresh-client
.Op Fl cDLRSU
.Op Fl cDlLRSU
.Op Fl A Ar pane:state
.Op Fl B Ar name:what:format
.Op Fl C Ar size
.Op Fl f Ar flags
.Op Fl l Op Ar target-pane
.Op Fl r Ar pane:report
.Op Fl t Ar target-client
.Op Ar adjustment
@@ -1487,11 +1486,7 @@ a colon, then a report escape sequence.
.Fl l
requests the clipboard from the client using the
.Xr xterm 1
escape sequence.
If
.Ar target-pane
is given, the clipboard is sent (in encoded form), otherwise it is stored in a
new paste buffer.
escape sequence and stores it in a new paste buffer.
.Pp
.Fl L ,
.Fl R ,
@@ -4239,6 +4234,32 @@ passed through to applications running in
.Nm .
Attached clients should be detached and attached again after changing this
option.
.It Xo Ic get-clipboard
.Op Ic both | request | buffer | off
.Xc
Controls the behaviour when an application requests the clipboard from
.Nm .
.Pp
If
.Ic off ,
the request is ignored;
if
.Ic buffer ,
.Nm
responds with the newest paste buffer;
.Ic request
causes
.Nm
to request the clipboard from the most recently used client (if possible) and
send the reply (if any) back to the application;
.Ic buffer
is the same as
.Ic request
but also creates a paste buffer.
.Pp
See also the
.Ic set-clipboard
option.
.It Ic history-file Ar path
If not empty, a file to which
.Nm