[PATCH 12/20] fbconsole: restrict cursor visibility to DEC private mode 25
Ahmad Fatoum
a.fatoum at barebox.org
Sun May 3 01:33:14 PDT 2026
`CSI ? Pm h' is DECSET and `CSI ? Pm l` is DECRST.
The Pm parameter can be 25 for cursor visibility control, but can also
mean many other things, e.g. use of the alternate screen buffer.
We currently assume 25 to be the Pm value without any parsing.
To allow support for further DEC private modes, have the DECSET/DECRST
handling code not ignore the Pm value.
No functional change expected as we have no barebox command that emits
any private mode other than 25.
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
drivers/video/fbconsole.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/video/fbconsole.c b/drivers/video/fbconsole.c
index ad3c66b75737..fb6a7d3e5809 100644
--- a/drivers/video/fbconsole.c
+++ b/drivers/video/fbconsole.c
@@ -602,11 +602,13 @@ static bool fbc_parse_csi(struct fbc_priv *priv)
break;
case 'h':
/* suffix for vt100 "[?25h" */
- switch (priv->csi_cmd) {
- case '?': /* cursor visible */
+ if (priv->csi_cmd != '?')
+ break;
+ pos = simple_strtoul(priv->csi + 1, NULL, 10);
+ switch (pos) {
+ case 25: /* cursor visible */
if (!(priv->cur.flags & HIDE_CURSOR))
break;
-
priv->cur.flags &= ~HIDE_CURSOR;
/* show cursor now */
toggle_cursor_visibility(priv);
@@ -615,10 +617,13 @@ static bool fbc_parse_csi(struct fbc_priv *priv)
break;
case 'l':
/* suffix for vt100 "[?25l" */
- switch (priv->csi_cmd) {
- case '?': /* cursor invisible */
- /* hide cursor now */
+ if (priv->csi_cmd != '?')
+ break;
+ pos = simple_strtoul(priv->csi + 1, NULL, 10);
+ switch (pos) {
+ case 25: /* cursor invisible */
toggle_cursor_visibility(priv);
+ /* hide cursor now */
priv->cur.flags |= HIDE_CURSOR;
return true;
}
--
2.47.3
More information about the barebox
mailing list