Blob Blame History Raw
From 3cfd45bb22cdcb1512228c3f8101a1e3f74af3ee Mon Sep 17 00:00:00 2001
From: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Date: Mon, 6 Apr 2020 16:05:56 +0530
Subject: [PATCH 2/3] daemonized-mode: fix issues noticed with curser position

* get/set x and y postions of the curser dynamically
* skip accepting command if no command is provided
  eg: just hit enter with no command

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
---
 scripts/targetcli | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/targetcli b/scripts/targetcli
index 3496126..97f41eb 100755
--- a/scripts/targetcli
+++ b/scripts/targetcli
@@ -192,9 +192,13 @@ def switch_to_daemon(shell, interactive):
     real_exit=False
     while True:
         shell.con.raw_write("/> ")
+        pos = shell.con.get_cursor_xy()
+        shell.con.set_cursor_xy(pos[0], pos[1])
         command = six.moves.input()
         if command.lower() == "exit":
             real_exit=True
+        elif not command:
+            continue
         if not interactive:
             inputs.append(command)
             if real_exit:
-- 
2.21.0