-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Reline behind a feature flag #19559
base: master
Are you sure you want to change the base?
Reline behind a feature flag #19559
Conversation
1f24c46
to
879750b
Compare
7753956
to
6fb1316
Compare
6fb1316
to
d2b887e
Compare
tools/exploit/nasm_shell.rb
Outdated
@@ -22,6 +22,7 @@ | |||
require 'msfenv' | |||
require 'rex' | |||
require 'readline' | |||
require 'reline' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these are redundant if choosing readline libraries is handled by msfenv 👀
d2b887e
to
89b9148
Compare
2b30a4b
to
86af256
Compare
@@ -547,7 +547,7 @@ def cmd_irb(*args) | |||
if expressions.empty? | |||
print_status('Starting IRB shell...') | |||
print_status("You are in the \"self\" (session) object\n") | |||
framework.history_manager.with_context(name: :irb) do | |||
framework.history_manager.with_context(name: :irb, input_library: :reline) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to be using the feature flag check to choose between reline or not 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IRB always uses Reline, unless we specify @CONF[:USE_SINGLELINE] = true
when setting up the IRB shell, which we don't currently do here:
IRB.setup(nil) |
:reline
if !use_singleline
or use_multiline
as they are xor'd.
86af256
to
76285da
Compare
@@ -28,6 +28,7 @@ def run | |||
|
|||
IRB.setup(nil) | |||
IRB.conf[:PROMPT_MODE] = :SIMPLE | |||
IRB.conf[:USE_MULTILINE] = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using this to make sure that IRB uses Reline, allowing us to set input_library: :reline
in calls to with_context
when interacting with the history manager.
76285da
to
c743203
Compare
|
c743203
to
7692b61
Compare
This PR is a continuation of #19397
This PR adds in the usage of the Reline library behind a feature flag.
Reline currently has some bugs/issues/inconsistencies compared to Readline. These are tracked as issue reports on Reline's GitHub.
These include:
We are moving away from Readline in favor if a pure Ruby implementation.
We are having to remove Readline on newer Windows 11 hosts due to an issue that Reline also encountered (and fixed since), where the console output handle would sometimes be incorrect, likely after calling popen, thus calls to console APIs such as
SetConsoleCursorPosition
would fail. A workaround is to periodically refresh the handle variable by callinghandle = GetStdHandle.call(-11) // for STDOUT
.Verification