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

Monkey-patch Readline to fix unresponsiveness on Windows 11 #19571

Merged

Conversation

sjanusz-r7
Copy link
Contributor

This PR fixes #19294

This PR adds in a Windows-only monkey-patch to RbReadline that forces the console handle to be refreshed to fix an issue where the Windows 11 console would not delete the characters in the console.

Note that the -L / real-readline option remains broken, and applying this patch to Readline did not fix it.

Verification

  • Start msfconsole
  • Confirm you can interact with the console by typing and removing text
  • Confirm Windows 11 is fixed
  • Confirm Windows 10 continues to work as normal

# Only Windows requires a monkey-patched RbReadline
return unless Rex::Compat.is_windows

if defined?(::RbReadline)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if defined?(::RbReadline)
if defined?(::RbReadline) && !defined?(RbReadline::refresh_console_handle)

I don't think we need to monkey patch this multiple times

@adfoster-r7
Copy link
Contributor

I think this might have introduced a small performance regression, but it's hard to confirm with my local VM setup being slow to begin with. Will land for now as it fixes the issue which entirely blocks windows 11 users, and we can be smarter about when the refresh happens later 👍

@adfoster-r7 adfoster-r7 merged commit 27fa707 into rapid7:master Oct 18, 2024
36 checks passed
@adfoster-r7
Copy link
Contributor

adfoster-r7 commented Oct 18, 2024

Release Notes

Fixes an issue that stopped users from using navigational arrow keys in msfconsole on newer Windows 11 installs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keyboard Input Issues in msfconsole on PowerShell After Update to v6.4.16 Windows11
2 participants