Skip to content

Commit 739c9c1

Browse files
committed
Ensure cursor is positioned appropriately if it is not at the end of a line when async prints arrive
1 parent 491a3a3 commit 739c9c1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/rex/ui/text/output.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ def print_status(msg = '')
6161
end
6262

6363
def print_line(msg = '')
64+
print("\033[s") # Save cursor position
6465
print("\r\033[K" + msg + "\n")
6566
if input and input.prompt
6667
print("\r\033[K")
6768
print(input.prompt)
6869
print(input.line_buffer)
70+
print("\033[u\033[B") # Restore cursor, move down one line
6971
end
7072
end
7173

0 commit comments

Comments
 (0)