summaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-11-03 16:01:14 +0000
committerThomas Adam <thomas@xteddy.org>2021-11-03 16:01:14 +0000
commit77fc7ac3be1320a02cf82c329d0031a472b8cf8f (patch)
treebd6e8100bdacb2eb1d927b7f7cf67e568f48a19c /screen.c
parent1fc0d1b74f23c8cefb339c3c4bd8af4acf6d63f8 (diff)
parent57100376cc70739f53a1f8a4bacf192b8cdcd124 (diff)
Merge branch 'obsd-master' into master
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/screen.c b/screen.c
index 3c01a29d..7046e098 100644
--- a/screen.c
+++ b/screen.c
@@ -81,6 +81,8 @@ screen_init(struct screen *s, u_int sx, u_int sy, u_int hlimit)
s->path = NULL;
s->cstyle = SCREEN_CURSOR_DEFAULT;
+ s->default_cstyle = SCREEN_CURSOR_DEFAULT;
+ s->default_mode = 0;
s->ccolour = -1;
s->default_ccolour = -1;
s->tabs = NULL;
@@ -151,38 +153,38 @@ screen_reset_tabs(struct screen *s)
bit_set(s->tabs, i);
}
-/* Set screen cursor style. */
+/* Set screen cursor style and mode. */
void
-screen_set_cursor_style(struct screen *s, u_int style)
+screen_set_cursor_style(u_int style, enum screen_cursor_style *cstyle,
+ int *mode)
{
- log_debug("%s: new %u, was %u", __func__, style, s->cstyle);
switch (style) {
case 0:
- s->cstyle = SCREEN_CURSOR_DEFAULT;
+ *cstyle = SCREEN_CURSOR_DEFAULT;
break;
case 1:
- s->cstyle = SCREEN_CURSOR_BLOCK;
- s->mode |= MODE_CURSOR_BLINKING;
+ *cstyle = SCREEN_CURSOR_BLOCK;
+ *mode |= MODE_CURSOR_BLINKING;
break;
case 2:
- s->cstyle = SCREEN_CURSOR_BLOCK;
- s->mode &= ~MODE_CURSOR_BLINKING;
+ *cstyle = SCREEN_CURSOR_BLOCK;
+ *mode &= ~MODE_CURSOR_BLINKING;
break;
case 3:
- s->cstyle = SCREEN_CURSOR_UNDERLINE;
- s->mode |= MODE_CURSOR_BLINKING;
+ *cstyle = SCREEN_CURSOR_UNDERLINE;
+ *mode |= MODE_CURSOR_BLINKING;
break;
case 4:
- s->cstyle = SCREEN_CURSOR_UNDERLINE;
- s->mode &= ~MODE_CURSOR_BLINKING;
+ *cstyle = SCREEN_CURSOR_UNDERLINE;
+ *mode &= ~MODE_CURSOR_BLINKING;
break;
case 5:
- s->cstyle = SCREEN_CURSOR_BAR;
- s->mode |= MODE_CURSOR_BLINKING;
+ *cstyle = SCREEN_CURSOR_BAR;
+ *mode |= MODE_CURSOR_BLINKING;
break;
case 6:
- s->cstyle = SCREEN_CURSOR_BAR;
- s->mode &= ~MODE_CURSOR_BLINKING;
+ *cstyle = SCREEN_CURSOR_BAR;
+ *mode &= ~MODE_CURSOR_BLINKING;
break;
}
}