Skip to content

Commit f9b3a9b

Browse files
author
Prasanna Kumar Kalever
committed
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 <[email protected]>
1 parent 15abdd4 commit f9b3a9b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/targetcli

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,14 @@ def switch_to_daemon(shell, interactive):
192192
real_exit=False
193193
while True:
194194
shell.con.raw_write("/> ")
195+
x_orig = shell.con.get_cursor_xy()[0]
196+
y_pos = shell.con.get_cursor_xy()[1]
197+
shell.con.set_cursor_xy(x_orig, y_pos)
195198
command = six.moves.input()
196199
if command.lower() == "exit":
197200
real_exit=True
201+
elif not command:
202+
continue
198203
if not interactive:
199204
inputs.append(command)
200205
if real_exit:

0 commit comments

Comments
 (0)