File tree Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Expand file tree Collapse file tree 2 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -63,18 +63,7 @@ def print_status(msg = '')
63
63
end
64
64
65
65
def print_line ( msg = '' )
66
- if ( /mingw/ =~ RUBY_PLATFORM )
67
- print ( msg + "\n " )
68
- return
69
- end
70
- print ( "\033 [s" ) # Save cursor position
71
- print ( "\r \033 [K" + msg + "\n " )
72
- if input and input . prompt
73
- print ( "\r \033 [K" )
74
- print ( input . prompt . tr ( "\001 \002 " , '' ) )
75
- print ( input . line_buffer . tr ( "\001 \002 " , '' ) )
76
- print ( "\033 [u\033 [B" ) # Restore cursor, move down one line
77
- end
66
+ print ( msg + "\n " )
78
67
end
79
68
80
69
def print_warning ( msg = '' )
Original file line number Diff line number Diff line change @@ -55,6 +55,23 @@ def io
55
55
@io ||= $stdout
56
56
end
57
57
58
+ # Use ANSI Control chars to reset prompt position for async output
59
+ # SEE https://github.com/rapid7/metasploit-framework/pull/7570
60
+ def print_line ( msg = '' )
61
+ if ( /mingw/ =~ RUBY_PLATFORM )
62
+ print ( msg + "\n " )
63
+ return
64
+ end
65
+ print ( "\033 [s" ) # Save cursor position
66
+ print ( "\r \033 [K" + msg + "\n " )
67
+ if input and input . prompt
68
+ print ( "\r \033 [K" )
69
+ print ( input . prompt . tr ( "\001 \002 " , '' ) )
70
+ print ( input . line_buffer . tr ( "\001 \002 " , '' ) )
71
+ print ( "\033 [u\033 [B" ) # Restore cursor, move down one line
72
+ end
73
+ end
74
+
58
75
#
59
76
# Prints the supplied message to standard output.
60
77
#
You can’t perform that action at this time.
0 commit comments