summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-10-07 10:01:10 +0100
committerThomas Adam <thomas@xteddy.org>2021-10-07 10:01:10 +0100
commitfed7b29c7e4995eb60ad765c4ff9439f68261c83 (patch)
treeb27293999c7df89ed14984abe9e532b6b4e135f4
parent537441742836b4366c47ad60c19e04463bfd02e3 (diff)
parent5f63181ed5a9d409fcb0955217fbe4c1a40dd9ff (diff)
Merge branch 'obsd-master' into master
-rw-r--r--cmd-display-message.c8
-rw-r--r--cmd-split-window.c26
-rw-r--r--tmux.11
-rw-r--r--window.c6
4 files changed, 28 insertions, 13 deletions
diff --git a/cmd-display-message.c b/cmd-display-message.c
index 596f0b5c..7828f694 100644
--- a/cmd-display-message.c
+++ b/cmd-display-message.c
@@ -75,12 +75,16 @@ cmd_display_message_exec(struct cmd *self, struct cmdq_item *item)
if (args_has(args, 'I')) {
if (wp == NULL)
return (CMD_RETURN_NORMAL);
- if (window_pane_start_input(wp, item, &cause) != 0) {
+ switch (window_pane_start_input(wp, item, &cause)) {
+ case -1:
cmdq_error(item, "%s", cause);
free(cause);
return (CMD_RETURN_ERROR);
+ case 1:
+ return (CMD_RETURN_NORMAL);
+ case 0:
+ return (CMD_RETURN_WAIT);
}
- return (CMD_RETURN_WAIT);
}
if (args_has(args, 'F') && count != 0) {
diff --git a/cmd-split-window.c b/cmd-split-window.c
index 74c8b5ab..888d4106 100644
--- a/cmd-split-window.c
+++ b/cmd-split-window.c
@@ -162,16 +162,22 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
environ_free(sc.environ);
return (CMD_RETURN_ERROR);
}
- if (input && window_pane_start_input(new_wp, item, &cause) != 0) {
- server_client_remove_pane(new_wp);
- layout_close_pane(new_wp);
- window_remove_pane(wp->window, new_wp);
- cmdq_error(item, "%s", cause);
- free(cause);
- if (sc.argv != NULL)
- cmd_free_argv(sc.argc, sc.argv);
- environ_free(sc.environ);
- return (CMD_RETURN_ERROR);
+ if (input) {
+ switch (window_pane_start_input(new_wp, item, &cause)) {
+ case -1:
+ server_client_remove_pane(new_wp);
+ layout_close_pane(new_wp);
+ window_remove_pane(wp->window, new_wp);
+ cmdq_error(item, "%s", cause);
+ free(cause);
+ if (sc.argv != NULL)
+ cmd_free_argv(sc.argc, sc.argv);
+ environ_free(sc.environ);
+ return (CMD_RETURN_ERROR);
+ case 1:
+ input = 0;
+ break;
+ }
}
if (!args_has(args, 'd'))
cmd_find_from_winlink_pane(current, wl, new_wp, 0);
diff --git a/tmux.1 b/tmux.1
index 2f032c76..9eee8fcd 100644
--- a/tmux.1
+++ b/tmux.1
@@ -3996,6 +3996,7 @@ If set to both, a bell and a message are produced.
Sets the session's conception of what characters are considered word
separators, for the purposes of the next and previous word commands in
copy mode.
+.El
.Pp
Available window options are:
.Pp
diff --git a/window.c b/window.c
index ec9644bc..d3e3f60f 100644
--- a/window.c
+++ b/window.c
@@ -1537,7 +1537,7 @@ window_pane_input_callback(struct client *c, __unused const char *path,
size_t len = EVBUFFER_LENGTH(buffer);
wp = window_pane_find_by_id(cdata->wp);
- if (wp == NULL || closed || error != 0 || c->flags & CLIENT_DEAD) {
+ if (wp == NULL || closed || error != 0 || (c->flags & CLIENT_DEAD)) {
if (wp == NULL)
c->flags |= CLIENT_EXIT;
@@ -1563,6 +1563,10 @@ window_pane_start_input(struct window_pane *wp, struct cmdq_item *item,
*cause = xstrdup("pane is not empty");
return (-1);
}
+ if (c->flags & (CLIENT_DEAD|CLIENT_EXITED))
+ return (1);
+ if (c->session != NULL)
+ return (1);
cdata = xmalloc(sizeof *cdata);
cdata->item = item;