summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-07-02 20:09:20 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-07-02 20:09:20 +0000
commitba628f59339c3f6c08b407e434a8a06f6fb27682 (patch)
tree46540015fa5e799e08016ba8bd3a6db192eb08fa /usr.bin/tmux
parentc151d38404b7fd9d815b5fc3b492f15ea9a55987 (diff)
Command prompt key presses need to avoid the command queue, GitHub issue
1817. Also a tmux.1 fix from jmc.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/server-client.c38
-rw-r--r--usr.bin/tmux/tmux.17
2 files changed, 21 insertions, 24 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index aaac84fd242..e795fff470c 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.290 2019/06/26 18:28:31 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.291 2019/07/02 20:09:19 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1026,16 +1026,6 @@ server_client_key_callback(struct cmdq_item *item, void *data)
fatal("gettimeofday failed");
session_update_activity(s, &c->activity_time);
- /* Handle status line. */
- if (~c->flags & CLIENT_READONLY)
- status_message_clear(c);
- if (c->prompt_string != NULL) {
- if (c->flags & CLIENT_READONLY)
- goto out;
- if (status_prompt_key(c, key) == 0)
- goto out;
- }
-
/* Check for mouse keys. */
m->valid = 0;
if (key == KEYC_MOUSE) {
@@ -1216,16 +1206,24 @@ server_client_handle_key(struct client *c, struct key_event *event)
return (0);
/*
- * Key presses in overlay mode are a special case. The queue might be
- * blocked so they need to be processed immediately rather than queued.
+ * Key presses in overlay mode and the command prompt are a special
+ * case. The queue might be blocked so they need to be processed
+ * immediately rather than queued.
*/
- if ((~c->flags & CLIENT_READONLY) && c->overlay_key != NULL) {
- switch (c->overlay_key(c, event)) {
- case 0:
- return (0);
- case 1:
- server_client_clear_overlay(c);
- return (0);
+ if (~c->flags & CLIENT_READONLY) {
+ status_message_clear(c);
+ if (c->prompt_string != NULL) {
+ if (status_prompt_key(c, event->key) == 0)
+ return (0);
+ }
+ if (c->overlay_key != NULL) {
+ switch (c->overlay_key(c, event)) {
+ case 0:
+ return (0);
+ case 1:
+ server_client_clear_overlay(c);
+ return (0);
+ }
}
}
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index b07c75db48e..aa5bc8a8673 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.674 2019/07/01 06:56:00 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.675 2019/07/02 20:09:19 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
@@ -14,7 +14,7 @@
.\" 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: July 1 2019 $
+.Dd $Mdocdate: July 2 2019 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -4337,8 +4337,7 @@ to unset.
.Ic align=right
.Xc
Align text to the left, centre or right of the available space if appropriate.
-.It Xo Ic fill=colour
-.Xc
+.It Ic fill=colour
Fill the available space with a background colour if appropriate.
.It Xo Ic list=on ,
.Ic list=focus ,