-/* $OpenBSD: server-client.c,v 1.413 2024/10/07 12:58:36 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.414 2024/10/08 06:29:44 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
if (c->overlay_draw != NULL) {
if (c->overlay_mode != NULL)
s = c->overlay_mode(c, c->overlay_data, &cx, &cy);
- } else
+ } else if (c->prompt_string == NULL)
s = wp->screen;
+ else
+ s = c->status.active;
if (s != NULL)
mode = s->mode;
if (log_get_level() != 0) {
cy = tty->sy - n;
}
cx = c->prompt_cursor;
-
- n = options_get_number(oo, "prompt-cursor-colour");
- s->default_ccolour = n;
- n = options_get_number(oo, "prompt-cursor-style");
- screen_set_cursor_style(n, &s->default_cstyle,
- &s->default_mode);
- } else {
- n = options_get_number(wp->options, "cursor-colour");
- s->default_ccolour = n;
- n = options_get_number(wp->options, "cursor-style");
- screen_set_cursor_style(n, &s->default_cstyle,
- &s->default_mode);
-
- 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 &&
- wp->yoff + s->cy >= oy &&
- wp->yoff + s->cy <= oy + sy) {
- cursor = 1;
-
- cx = wp->xoff + s->cx - ox;
- cy = wp->yoff + s->cy - oy;
-
- if (status_at_line(c) == 0)
- cy += status_line_size(c);
- }
- if (!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 &&
+ wp->yoff + s->cy >= oy && wp->yoff + s->cy <= oy + sy) {
+ cursor = 1;
+
+ cx = wp->xoff + s->cx - ox;
+ cy = wp->yoff + s->cy - oy;
+
+ if (status_at_line(c) == 0)
+ cy += status_line_size(c);
}
+ if (!cursor)
+ mode &= ~MODE_CURSOR;
}
log_debug("%s: cursor to %u,%u", __func__, cx, cy);
tty_cursor(tty, cx, cy);
-/* $OpenBSD: status.c,v 1.247 2024/10/07 12:58:36 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.248 2024/10/08 06:29:44 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
struct screen_write_ctx ctx;
struct session *s = c->session;
struct screen old_screen;
- u_int i, lines, offset, left, start, width;
+ u_int i, lines, offset, left, start, width, n;
u_int pcursor, pwidth, promptline;
struct grid_cell gc;
struct format_tree *ft;
lines = 1;
screen_init(sl->active, c->tty.sx, lines, 0);
+ n = options_get_number(s->options, "prompt-cursor-colour");
+ sl->active->default_ccolour = n;
+ n = options_get_number(s->options, "prompt-cursor-style");
+ screen_set_cursor_style(n, &sl->active->default_cstyle,
+ &sl->active->default_mode);
+
promptline = status_prompt_line_at(c);
if (promptline > lines - 1)
promptline = lines - 1;