[vte] emulation: Port DECSCUSR to new parameter glue
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] emulation: Port DECSCUSR to new parameter glue
- Date: Tue, 27 Mar 2018 17:42:22 +0000 (UTC)
commit 2dbfddd9e5f866a5aa146a1af8c9b5b2012853bb
Author: Christian Persch <chpe src gnome org>
Date: Tue Mar 27 19:40:12 2018 +0200
emulation: Port DECSCUSR to new parameter glue
src/vteseq-list.hh | 1 -
src/vteseq.cc | 37 +++++++++++++------------------------
2 files changed, 13 insertions(+), 25 deletions(-)
---
diff --git a/src/vteseq-list.hh b/src/vteseq-list.hh
index 43b7e12..9f3b454 100644
--- a/src/vteseq-list.hh
+++ b/src/vteseq-list.hh
@@ -117,7 +117,6 @@ SEQUENCE_HANDLER(set_conformance_level)
SEQUENCE_HANDLER(set_current_directory_uri)
SEQUENCE_HANDLER(set_current_file_uri)
SEQUENCE_HANDLER(set_current_hyperlink)
-SEQUENCE_HANDLER(set_cursor_style)
SEQUENCE_HANDLER(set_icon_and_window_title)
SEQUENCE_HANDLER(set_icon_title)
SEQUENCE_HANDLER(set_mode)
diff --git a/src/vteseq.cc b/src/vteseq.cc
index b8c8a77..a5d5552 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -2383,29 +2383,6 @@ VteTerminalPrivate::seq_screen_alignment_test(vte::parser::Params const& params)
m_text_modified_flag = TRUE;
}
-/* DECSCUSR set cursor style */
-void
-VteTerminalPrivate::seq_set_cursor_style(vte::parser::Params const& params)
-{
- auto n_params = params.size();
- if (n_params > 1)
- return;
-
- int style;
- if (n_params == 0) {
- /* no parameters means default (according to vt100.net) */
- style = VTE_CURSOR_STYLE_TERMINAL_DEFAULT;
- } else {
- if (!params.number_at(0, style))
- return;
- if (style < 0 || style > 6) {
- return;
- }
- }
-
- set_cursor_style(VteCursorStyle(style));
-}
-
/* Perform a soft reset. */
void
VteTerminalPrivate::seq_soft_reset(vte::parser::Params const& params)
@@ -4207,14 +4184,26 @@ VteTerminalPrivate::DECSCUSR(vte::parser::Sequence const& seq)
* 2: steady block
* 3: blinking underline
* 4: steady underline
+ * 5: blinking ibeam (XTERM)
+ * 6: steady ibeam (XTERM)
* Changing this setting does _not_ affect the cursor visibility itself.
* Use DECTCEM for that.
*
* Defaults:
* args[0]: 0
+ *
+ * References: VT525 5–126
+ * XTERM
*/
- seq_set_cursor_style(seq);
+ auto param = seq.collect1(0, 0);
+ switch (param) {
+ case 0 ... 6:
+ set_cursor_style(VteCursorStyle(param));
+ break;
+ default:
+ break;
+ }
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]