summaryrefslogtreecommitdiffstats
path: root/server-client.c
diff options
context:
space:
mode:
authornicm <nicm>2021-11-15 10:58:13 +0000
committernicm <nicm>2021-11-15 10:58:13 +0000
commitb55f0ac6b94449b3372f0d1737fcf967f4fa13a2 (patch)
tree7990e52a80163eeaa327068efa9411de02a148f8 /server-client.c
parentcb8a0d83fbaa2ae49c06105cb94d247ef20ed91e (diff)
Leave the hardware cursor at the position of the selected line in choose
modes and current editing position and at the command prompt. It is invisible but this is helpful for people using screen readers. GitHub issue 2970.
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/server-client.c b/server-client.c
index 7cea32c0..072c5589 100644
--- a/server-client.c
+++ b/server-client.c
@@ -1706,7 +1706,7 @@ server_client_reset_state(struct client *c)
struct window_pane *wp = server_client_get_pane(c), *loop;
struct screen *s = NULL;
struct options *oo = c->session->options;
- int mode = 0, cursor, flags;
+ int mode = 0, cursor, flags, n;
u_int cx = 0, cy = 0, ox, oy, sx, sy;
if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))
@@ -1734,7 +1734,20 @@ server_client_reset_state(struct client *c)
tty_margin_off(tty);
/* Move cursor to pane cursor and offset. */
- if (c->overlay_draw == NULL) {
+ if (c->prompt_string != NULL) {
+ n = options_get_number(c->session->options, "status-position");
+ if (n == 0)
+ cy = 0;
+ else {
+ n = status_line_size(c);
+ if (n == 0)
+ cy = tty->sy - 1;
+ else
+ cy = tty->sy - n;
+ }
+ cx = c->prompt_cursor;
+ mode &= ~MODE_CURSOR;
+ } else if (c->overlay_draw == NULL) {
cursor = 0;
tty_window_offset(tty, &ox, &oy, &sx, &sy);
if (wp->xoff + s->cx >= ox && wp->xoff + s->cx <= ox + sx &&