Ensure cursor is positioned appropriately if it is not at the end of a line when async prints arrive

bug/bundler_fix
Dylan Davis 2016-11-16 21:07:50 -07:00
parent 491a3a3162
commit 739c9c1315
1 changed files with 2 additions and 0 deletions

View File

@ -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