File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
lib/rex/post/sql/ui/console Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -84,9 +84,16 @@ def _multiline
84
84
::Reline . prompt_proc = proc { |line_buffer | line_buffer . each_with_index . map { |_line , i | i > 0 ? 'SQL *> ' : 'SQL >> ' } }
85
85
86
86
# We want to do this in a loop
87
+ # multiline_input is the whole string that the user has input, not just the current line.
87
88
raw_query = ::Reline . readmultiline ( 'SQL >> ' , use_history = true ) do |multiline_input |
88
89
# The user pressed ctrl + c or ctrl + z and wants to background our SQL prompt
89
90
return { status : :exit , result : nil } unless self . interacting
91
+ # When the user has pressed the enter key with no input, don't run any queries;
92
+ # simply give them a new prompt on a new line.
93
+ if multiline_input . chomp . empty?
94
+ print_blank_line
95
+ return { status : :success , result : nil }
96
+ end
90
97
91
98
# In the case only a stop word was input, exit out of the REPL shell
92
99
finished = ( multiline_input . split . count == 1 && stop_words . include? ( multiline_input . split . last ) )
You can’t perform that action at this time.
0 commit comments