Allow clients to query if the terminal emulator support styled underlines
This commit is contained in:
parent
924172f1ac
commit
edab1aebaa
@ -76,5 +76,8 @@
|
|||||||
#define BRACKETED_PASTE_START "\033[200~"
|
#define BRACKETED_PASTE_START "\033[200~"
|
||||||
#define BRACKETED_PASTE_END "\033[201~"
|
#define BRACKETED_PASTE_END "\033[201~"
|
||||||
|
|
||||||
|
// Styled underlines
|
||||||
|
#define STYLED_UNDERLINES (2016 << 5)
|
||||||
|
|
||||||
// Extended keyboard protocol
|
// Extended keyboard protocol
|
||||||
#define EXTENDED_KEYBOARD (2017 << 5)
|
#define EXTENDED_KEYBOARD (2017 << 5)
|
||||||
|
|||||||
@ -923,6 +923,8 @@ report_mode_status(Screen *self, unsigned int which, bool private) {
|
|||||||
KNOWN_MODE(EXTENDED_KEYBOARD);
|
KNOWN_MODE(EXTENDED_KEYBOARD);
|
||||||
KNOWN_MODE(FOCUS_TRACKING);
|
KNOWN_MODE(FOCUS_TRACKING);
|
||||||
#undef KNOWN_MODE
|
#undef KNOWN_MODE
|
||||||
|
case STYLED_UNDERLINES:
|
||||||
|
ans = 3; break;
|
||||||
}
|
}
|
||||||
if (snprintf(buf, sizeof(buf) - 1, "\x1b[%s%u;%u$y", (private ? "?" : ""), which, ans)) callback("write_to_child", self, buf, 0);
|
if (snprintf(buf, sizeof(buf) - 1, "\x1b[%s%u;%u$y", (private ? "?" : ""), which, ans)) callback("write_to_child", self, buf, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,6 +139,9 @@ class TestParser(BaseTest):
|
|||||||
pb('\033[?1l', ('screen_reset_mode', 1, 1))
|
pb('\033[?1l', ('screen_reset_mode', 1, 1))
|
||||||
self.assertFalse(s.cursor_key_mode)
|
self.assertFalse(s.cursor_key_mode)
|
||||||
c.clear()
|
c.clear()
|
||||||
|
pb('\033[?2016$p', ('report_mode_status', 2016, 1))
|
||||||
|
self.ae(c.wtcbuf, b'\033[?2016;3$y')
|
||||||
|
c.clear()
|
||||||
pb('\033[?1$p', ('report_mode_status', 1, 1))
|
pb('\033[?1$p', ('report_mode_status', 1, 1))
|
||||||
self.ae(c.wtcbuf, b'\033[?1;2$y')
|
self.ae(c.wtcbuf, b'\033[?1;2$y')
|
||||||
pb('\033[2;4r', ('screen_set_margins', 2, 4))
|
pb('\033[2;4r', ('screen_set_margins', 2, 4))
|
||||||
|
|||||||
@ -44,6 +44,23 @@ To reset the underline color (also previously reserved and unused):
|
|||||||
<ESC>[59m
|
<ESC>[59m
|
||||||
```
|
```
|
||||||
|
|
||||||
|
A client can query if the terminal emulator supports this underline extension using the
|
||||||
|
standard link:http://vt100.net/docs/vt510-rm/DECRQM[DECRQM] escape sequence, with the
|
||||||
|
mode value `2016`, like this:
|
||||||
|
|
||||||
|
Client sends:
|
||||||
|
|
||||||
|
```
|
||||||
|
<ESC>[?2016$p
|
||||||
|
```
|
||||||
|
|
||||||
|
If the terminal supports this underline extension, it must respond with
|
||||||
|
link:http://vt100.net/docs/vt510-rm/DECRPM[DECRPM]
|
||||||
|
|
||||||
|
```
|
||||||
|
<ESC>[?2016;3$p
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
== Graphics rendering
|
== Graphics rendering
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user