tools/kvm_stat: hide cursor
authorStefan Raspl <raspl@linux.vnet.ibm.com>
Fri, 10 Mar 2017 12:40:00 +0000 (13:40 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 29 Mar 2017 10:01:24 +0000 (12:01 +0200)
When running kvm_stat in interactive mode, the cursor appears at the lower
left corner, which looks a bit distracting.
This patch hides the cursor by turning it invisible.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Reviewed-By: Sascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
tools/kvm/kvm_stat/kvm_stat

index 581278c5848877ea1a90cfdbf8045afd23298c0c..8cc83a309e65eee668da9ed340a636ec822a1267 100755 (executable)
@@ -812,6 +812,13 @@ class Tui(object):
         except:
             pass
 
+        # Hide cursor in extra statement as some monochrome terminals
+        # might support hiding but not colors.
+        try:
+            curses.curs_set(0)
+        except curses.error:
+            pass
+
         curses.use_default_colors()
         return self