From f89dc03a57740d8c34a1def2eb13ebd9cb42006f Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 6 Oct 2021 10:33:12 +0000 Subject: [PATCH] Do not reset cursor to default if it has never been changed, fixes problem reported by naddy. --- usr.bin/tmux/tty.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 25eabdb45c4..9426448acda 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.404 2021/10/05 12:46:02 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.405 2021/10/06 10:33:12 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -692,10 +692,12 @@ tty_update_cursor(struct tty *tty, int mode, int changed, struct screen *s) tty_putcode(tty, TTYC_CNORM); switch (cstyle) { case SCREEN_CURSOR_DEFAULT: - if (tty_term_has(tty->term, TTYC_SE)) - tty_putcode(tty, TTYC_SE); - else - tty_putcode1(tty, TTYC_SS, 0); + if (tty->cstyle != SCREEN_CURSOR_DEFAULT) { + if (tty_term_has(tty->term, TTYC_SE)) + tty_putcode(tty, TTYC_SE); + else + tty_putcode1(tty, TTYC_SS, 0); + } if (mode & (MODE_CURSOR_BLINKING|MODE_CURSOR_VERY_VISIBLE)) tty_putcode(tty, TTYC_CVVIS); break; -- 2.20.1