Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve interactive shell performance for pasted user input #15684

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rex/post/meterpreter/ui/console/interactive_channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _interact_complete
#
def _stream_read_local_write_remote(channel)
if raw
data = user_input.getch
data = user_input.sysread(1024)
else
data = user_input.gets
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this PR, but also noticing that there's a call to handle a line of user input:

self.on_command_proc.call(data.strip) if self.on_command_proc

Which interactive shells may break the assumptions of

Expand Down
7 changes: 0 additions & 7 deletions lib/rex/ui/text/input/readline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ def gets()
end
end

def getch()
begin
self.fd.getch
rescue ::Errno::EINTR
retry
end
end
#
# Stick readline into a low-priority thread so that the scheduler doesn't slow
# down other background threads. This is important when there are many active
Expand Down