You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2019/10/17 17:10:51 UTC

[mynewt-core] branch master updated: sys/console: Hide cursor in log area

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 7c9864a  sys/console: Hide cursor in log area
7c9864a is described below

commit 7c9864afeea707df155a2acedced5e19d4c19000
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Thu Oct 17 15:27:02 2019 +0200

    sys/console: Hide cursor in log area
    
    Code hides cursor in log area to improve console usage experience.
---
 sys/console/full/src/console.c | 6 ++++++
 sys/console/full/syscfg.yml    | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/sys/console/full/src/console.c b/sys/console/full/src/console.c
index 829b8ed..e259a5a 100644
--- a/sys/console/full/src/console.c
+++ b/sys/console/full/src/console.c
@@ -387,6 +387,9 @@ console_switch_to_prompt(void)
             console_write_str(CSI "0m");
             console_out_nolock(c);
             console_out_nolock('\b');
+            if (MYNEWT_VAL(CONSOLE_HIDE_CURSOR_IN_LOG_AREA)) {
+                console_write_str(CSI "?25h");
+            }
         }
     }
 }
@@ -417,6 +420,9 @@ console_switch_to_logs(void)
                 c = ' ';
             }
             console_out_nolock(c);
+            if (MYNEWT_VAL(CONSOLE_HIDE_CURSOR_IN_LOG_AREA)) {
+                console_write_str(CSI "?25l");
+            }
             console_write_str(CSI "0m\b");
         }
         cursor_restore();
diff --git a/sys/console/full/syscfg.yml b/sys/console/full/syscfg.yml
index e8334b9..a71f95f 100644
--- a/sys/console/full/syscfg.yml
+++ b/sys/console/full/syscfg.yml
@@ -65,6 +65,10 @@ syscfg.defs:
             For black and white (minicom) use "7m" - inverse
             For color (putty) use "30;42m" - black/green
         value: '"7m"'
+    CONSOLE_HIDE_CURSOR_IN_LOG_AREA:
+        description: >
+            Hide cursor in log area.
+        value: 1
 
     CONSOLE_UART_BAUD:
         description: 'Console UART baud rate.'