in GitHub issue 3830.
-/* $OpenBSD: cmd-paste-buffer.c,v 1.41 2021/08/21 10:22:39 nicm Exp $ */
+/* $OpenBSD: cmd-paste-buffer.c,v 1.42 2024/02/13 08:03:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
size_t seplen, bufsize;
int bracket = args_has(args, 'p');
+ if (window_pane_exited(wp)) {
+ cmdq_error(item, "target pane has exited");
+ return (CMD_RETURN_ERROR);
+ }
+
bufname = NULL;
if (args_has(args, 'b'))
bufname = args_get(args, 'b');
-/* $OpenBSD: cmd-pipe-pane.c,v 1.60 2022/05/30 13:03:46 nicm Exp $ */
+/* $OpenBSD: cmd-pipe-pane.c,v 1.61 2024/02/13 08:03:50 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
sigset_t set, oldset;
/* Do nothing if pane is dead. */
- if (wp->fd == -1 || (wp->flags & PANE_EXITED)) {
+ if (window_pane_exited(wp)) {
cmdq_error(item, "target pane has exited");
return (CMD_RETURN_ERROR);
}
-/* $OpenBSD: tmux.h,v 1.1211 2023/09/15 15:49:05 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1212 2024/02/13 08:03:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
struct session *, struct winlink *, key_code,
struct mouse_event *);
int window_pane_visible(struct window_pane *);
+int window_pane_exited(struct window_pane *);
u_int window_pane_search(struct window_pane *, const char *, int,
int);
const char *window_printable_flags(struct winlink *, int);
-/* $OpenBSD: window.c,v 1.287 2023/10/23 08:12:00 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.288 2024/02/13 08:03:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
return (wp == wp->window->active);
}
+int
+window_pane_exited(struct window_pane *wp)
+{
+ return (wp->fd == -1 || (wp->flags & PANE_EXITED));
+}
+
u_int
window_pane_search(struct window_pane *wp, const char *term, int regex,
int ignore)