mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Add a hook when the clipboard is set.
This commit is contained in:
parent
8c4ae1c938
commit
74b2deae1c
1
input.c
1
input.c
@ -2174,6 +2174,7 @@ input_osc_52(struct window_pane *wp, const char *p)
|
|||||||
screen_write_start(&ctx, wp, NULL);
|
screen_write_start(&ctx, wp, NULL);
|
||||||
screen_write_setselection(&ctx, out, outlen);
|
screen_write_setselection(&ctx, out, outlen);
|
||||||
screen_write_stop(&ctx);
|
screen_write_stop(&ctx);
|
||||||
|
notify_pane("pane-set-clipboard", wp);
|
||||||
|
|
||||||
paste_add(out, outlen);
|
paste_add(out, outlen);
|
||||||
}
|
}
|
||||||
|
14
tmux.1
14
tmux.1
@ -2420,13 +2420,15 @@ The default is 100.
|
|||||||
.Op Ic on | external | off
|
.Op Ic on | external | off
|
||||||
.Xc
|
.Xc
|
||||||
Attempt to set the terminal clipboard content using the
|
Attempt to set the terminal clipboard content using the
|
||||||
\ee]52;...\e007
|
|
||||||
.Xr xterm 1
|
.Xr xterm 1
|
||||||
escape sequences, if there is an
|
escape sequence, if there is an
|
||||||
.Em \&Ms
|
.Em \&Ms
|
||||||
entry in the
|
entry in the
|
||||||
.Xr terminfo 5
|
.Xr terminfo 5
|
||||||
description.
|
description (see the
|
||||||
|
.Sx TERMINFO EXTENSIONS
|
||||||
|
section).
|
||||||
|
.Pp
|
||||||
If set to
|
If set to
|
||||||
.Ic on ,
|
.Ic on ,
|
||||||
.Nm
|
.Nm
|
||||||
@ -3230,7 +3232,7 @@ set-hook after-split-window "selectl even-vertical"
|
|||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
In addition, the following hooks are available:
|
In addition, the following hooks are available:
|
||||||
.Bl -tag -width "XXXXXXXXXXXXXXXX"
|
.Bl -tag -width "XXXXXXXXXXXXXXXXXXXXXX"
|
||||||
.It alert-activity
|
.It alert-activity
|
||||||
Run when a window has activity.
|
Run when a window has activity.
|
||||||
See
|
See
|
||||||
@ -3255,6 +3257,10 @@ Run when the program running in a pane exits, but
|
|||||||
is on so the pane has not closed.
|
is on so the pane has not closed.
|
||||||
.It pane-exited
|
.It pane-exited
|
||||||
Run when the program running in a pane exits.
|
Run when the program running in a pane exits.
|
||||||
|
.It pane-set-clipboard
|
||||||
|
Run when the terminal clipboard is set using the
|
||||||
|
.Xr xterm 1
|
||||||
|
escape sequence.
|
||||||
.It session-created
|
.It session-created
|
||||||
Run when a new session created.
|
Run when a new session created.
|
||||||
.It session-closed
|
.It session-closed
|
||||||
|
@ -1633,6 +1633,7 @@ window_copy_copy_buffer(struct window_pane *wp, const char *bufname, void *buf,
|
|||||||
screen_write_start(&ctx, wp, NULL);
|
screen_write_start(&ctx, wp, NULL);
|
||||||
screen_write_setselection(&ctx, buf, len);
|
screen_write_setselection(&ctx, buf, len);
|
||||||
screen_write_stop(&ctx);
|
screen_write_stop(&ctx);
|
||||||
|
notify_pane("pane-set-clipboard", wp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (paste_set(buf, len, bufname, NULL) != 0)
|
if (paste_set(buf, len, bufname, NULL) != 0)
|
||||||
@ -1690,6 +1691,7 @@ window_copy_append_selection(struct window_pane *wp, const char *bufname)
|
|||||||
screen_write_start(&ctx, wp, NULL);
|
screen_write_start(&ctx, wp, NULL);
|
||||||
screen_write_setselection(&ctx, buf, len);
|
screen_write_setselection(&ctx, buf, len);
|
||||||
screen_write_stop(&ctx);
|
screen_write_stop(&ctx);
|
||||||
|
notify_pane("pane-set-clipboard", wp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bufname == NULL || *bufname == '\0')
|
if (bufname == NULL || *bufname == '\0')
|
||||||
|
Loading…
Reference in New Issue
Block a user