-/* $OpenBSD: control-notify.c,v 1.30 2022/08/15 09:10:34 nicm Exp $ */
+/* $OpenBSD: control-notify.c,v 1.31 2022/10/28 13:00:02 nicm Exp $ */
/*
* Copyright (c) 2012 Nicholas Marriott <nicholas.marriott@gmail.com>
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c))
continue;
- control_write(c, "%%paste-changed %s", name);
+ control_write(c, "%%paste-buffer-changed %s", name);
+ }
+}
+
+void
+control_notify_paste_buffer_deleted(const char *name)
+{
+ struct client *c;
+
+ TAILQ_FOREACH(c, &clients, entry) {
+ if (!CONTROL_SHOULD_NOTIFY_CLIENT(c))
+ continue;
+
+ control_write(c, "%%paste-buffer-deleted %s", name);
}
}
-/* $OpenBSD: input.c,v 1.210 2022/10/28 12:20:28 nicm Exp $ */
+/* $OpenBSD: input.c,v 1.211 2022/10/28 13:00:02 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
input_csi_dispatch_sm_private(struct input_ctx *ictx)
{
struct screen_write_ctx *sctx = &ictx->ctx;
- struct window_pane *wp = ictx->wp;
struct grid_cell *gc = &ictx->cell.cell;
u_int i;
-/* $OpenBSD: notify.c,v 1.42 2022/08/15 09:10:34 nicm Exp $ */
+/* $OpenBSD: notify.c,v 1.43 2022/10/28 13:00:02 nicm Exp $ */
/*
* Copyright (c) 2012 George Nachman <tmux@georgester.com>
control_notify_session_window_changed(ne->session);
if (strcmp(ne->name, "paste-buffer-changed") == 0)
control_notify_paste_buffer_changed(ne->pbname);
+ if (strcmp(ne->name, "paste-buffer-deleted") == 0)
+ control_notify_paste_buffer_deleted(ne->pbname);
notify_insert_hook(item, ne);
}
void
-notify_paste_buffer(const char *pbname)
+notify_paste_buffer(const char *pbname, int deleted)
{
struct cmd_find_state fs;
cmd_find_clear_state(&fs, 0);
- notify_add("paste-buffer-changed", &fs, NULL, NULL, NULL, NULL, pbname);
+ if (deleted) {
+ notify_add("paste-buffer-deleted", &fs, NULL, NULL, NULL, NULL,
+ pbname);
+ } else {
+ notify_add("paste-buffer-changed", &fs, NULL, NULL, NULL, NULL,
+ pbname);
+ }
}
-/* $OpenBSD: paste.c,v 1.44 2022/08/15 09:10:34 nicm Exp $ */
+/* $OpenBSD: paste.c,v 1.45 2022/10/28 13:00:02 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
void
paste_free(struct paste_buffer *pb)
{
- notify_paste_buffer(pb->name);
+ notify_paste_buffer(pb->name, 1);
RB_REMOVE(paste_name_tree, &paste_by_name, pb);
RB_REMOVE(paste_time_tree, &paste_by_time, pb);
RB_INSERT(paste_name_tree, &paste_by_name, pb);
RB_INSERT(paste_time_tree, &paste_by_time, pb);
- notify_paste_buffer(pb->name);
+ notify_paste_buffer(pb->name, 0);
}
/* Rename a paste buffer. */
RB_INSERT(paste_name_tree, &paste_by_name, pb);
- notify_paste_buffer(oldname);
- notify_paste_buffer(newname);
+ notify_paste_buffer(oldname, 1);
+ notify_paste_buffer(newname, 0);
return (0);
}
RB_INSERT(paste_name_tree, &paste_by_name, pb);
RB_INSERT(paste_time_tree, &paste_by_time, pb);
- notify_paste_buffer(name);
+ notify_paste_buffer(name, 0);
return (0);
}
pb->data = data;
pb->size = size;
- notify_paste_buffer(pb->name);
+ notify_paste_buffer(pb->name, 0);
}
/* Convert start of buffer into a nice string. */
-.\" $OpenBSD: tmux.1,v 1.903 2022/09/28 07:59:50 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.904 2022/10/28 13:00:02 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: September 28 2022 $
+.Dd $Mdocdate: October 28 2022 $
.Dt TMUX 1
.Os
.Sh NAME
Paste buffer
.Ar name
has been changed.
+.It Ic %paste-buffer-deleted Ar name
+Paste buffer
+.Ar name
+has been deleted.
.It Ic %pause Ar pane-id
The pane has been paused (if the
.Ar pause-after
-/* $OpenBSD: tmux.h,v 1.1182 2022/09/28 07:55:29 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1183 2022/10/28 13:00:02 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
void notify_session_window(const char *, struct session *, struct window *);
void notify_window(const char *, struct window *);
void notify_pane(const char *, struct window_pane *);
-void notify_paste_buffer(const char *);
+void notify_paste_buffer(const char *, int);
/* options.c */
struct options *options_create(struct options *);
void control_notify_session_closed(struct session *);
void control_notify_session_window_changed(struct session *);
void control_notify_paste_buffer_changed(const char *);
+void control_notify_paste_buffer_deleted(const char *);
/* session.c */
extern struct sessions sessions;