File tree Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -140,14 +140,18 @@ def readline_with_output(prompt, add_history=false)
140
140
# []`Readline.readline`](https://github.com/luislavena/rb-readline/blob/ce4908dae45dbcae90a6e42e3710b8c3a1f2cd64/lib/readline.rb#L36-L58)
141
141
# for rb-readline to support setting input and output. Output needs to
142
142
# be set so that colorization works for the prompt on Windows.
143
- #
144
143
self . prompt = prompt
145
144
146
145
# TODO: there are unhandled quirks in async output buffering that
147
146
# we have not solved yet, for instance when loading meterpreter
148
147
# extensions, supporting Windows, printing output from commands, etc.
149
148
# Remove this guard when issues are resolved.
150
- # reset_sequence = "\n\001\r\033[K\002"
149
+ =begin
150
+ reset_sequence = "\n\001\r\033[K\002"
151
+ if (/mingw/ =~ RUBY_PLATFORM)
152
+ reset_sequence = ""
153
+ end
154
+ =end
151
155
reset_sequence = ""
152
156
153
157
if defined? RbReadline
Original file line number Diff line number Diff line change @@ -58,20 +58,24 @@ def io
58
58
# Use ANSI Control chars to reset prompt position for async output
59
59
# SEE https://github.com/rapid7/metasploit-framework/pull/7570
60
60
def print_line ( msg = '' )
61
-
62
61
# TODO: there are unhandled quirks in async output buffering that
63
62
# we have not solved yet, for instance when loading meterpreter
64
63
# extensions, supporting Windows, printing output from commands, etc.
65
64
# Remove this guard when issues are resolved.
66
- #
67
- # print("\033[s") # Save cursor position
68
- # print("\r\033[K" + msg + "\n")
69
- # if input and input.prompt
70
- # print("\r\033[K")
71
- # print(input.prompt.tr("\001\002", ''))
72
- # print(input.line_buffer.tr("\001\002", ''))
73
- # print("\033[u\033[B") # Restore cursor, move down one line
74
- # end
65
+ =begin
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
78
+ =end
75
79
76
80
print ( msg + "\n " )
77
81
end
You can’t perform that action at this time.
0 commit comments