In fbc_parse_colors, resetting attributes sets priv->flags = 0,
which clears all flags including HIDE_CURSOR.

This is incorrect, the reset should only clear SGR attributes,
not cursor visibility state that just happens to share the
same member, so account for that.

Link: https://terminalguide.namepad.de/seq/csi_sm/
Link: https://terminalguide.namepad.de/mode/p25/
Signed-off-by: Ahmad Fatoum <[email protected]>
---
 drivers/video/fbconsole.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbconsole.c b/drivers/video/fbconsole.c
index 547db00208ff..5b7c1a13a8bc 100644
--- a/drivers/video/fbconsole.c
+++ b/drivers/video/fbconsole.c
@@ -68,6 +68,7 @@ struct fbc_priv {
 
 #define ANSI_FLAG_INVERT       (1 << 0)
 #define ANSI_FLAG_BRIGHT       (1 << 1)
+#define SGR_ATTRIBUTES         (ANSI_FLAG_INVERT | ANSI_FLAG_BRIGHT)
 #define HIDE_CURSOR            (1 << 2)
        unsigned flags;
 
@@ -508,7 +509,7 @@ static void fbc_parse_colors(struct fbc_priv *priv)
                code = simple_strtoul(str, &str, 10);
                switch (code) {
                case 0:
-                       priv->flags = 0;
+                       priv->flags &= ~SGR_ATTRIBUTES;
                        priv->color = DEFAULT_COLOR;
                        priv->bgcolor = BLACK;
                        break;
-- 
2.47.3


Reply via email to