Ensure cursor is positioned appropriately if it is not at the end of a line when async prints arrive
parent
491a3a3162
commit
739c9c1315
|
@ -61,11 +61,13 @@ class Output < Rex::Ui::Output
|
|||
end
|
||||
|
||||
def print_line(msg = '')
|
||||
print("\033[s") # Save cursor position
|
||||
print("\r\033[K" + msg + "\n")
|
||||
if input and input.prompt
|
||||
print("\r\033[K")
|
||||
print(input.prompt)
|
||||
print(input.line_buffer)
|
||||
print("\033[u\033[B") # Restore cursor, move down one line
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue