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

Readline ANSI Escape Code [->dev] #33

Merged
merged 2 commits into from Mar 9, 2021
Merged

Readline ANSI Escape Code [->dev] #33

merged 2 commits into from Mar 9, 2021

Conversation

ghost
Copy link

@ghost ghost commented Feb 26, 2021

Describe the purpose of the pull request

ANSI was not being interpreted using the Readline module. The *Evil-WinRM* was not being parsed/printed correctly in the terminal when colors were enabled.

Versioning:

ruby -version                                                                                                                     
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux-gnu]
gem list readline
*** LOCAL GEMS ***
readline (default: 0.0.2)
readline-ext (default: 0.1.0)

Before:

image

After:

image

Please let me know if you would like to work with me to debug this issue further. However, this is the change I needed to make to make this work on my end. Not sure if there is anyone else out there with this issue.

ANSI was not being interpreted using Readline (not sure why)
@ghost ghost changed the title Update evil-winrm.rb Readline ANSI Escape Code Feb 26, 2021
@ghost ghost changed the title Readline ANSI Escape Code Readline ANSI Escape Code [->Dev] Feb 26, 2021
@ghost ghost changed the title Readline ANSI Escape Code [->Dev] Readline ANSI Escape Code [->dev] Feb 26, 2021
@devx00
Copy link

devx00 commented Mar 6, 2021

Just had the same problem. I tried your solution but it breaks some other things, namely using the arrow keys to scroll through your history. I was able to find the actual problem I think, but I'm a little confused how this appeared pretty randomly.

The fix is to change the return statement in the colorize function from this

return "\033[0;#{color_code}m#{text}\033[0m"

to this

return "\001\033[0;#{color_code}m\002#{text}\001\033[0m\002"

If you want to fix your PR you can go ahead and do that or I can submit one myself. @unKn0wnUser453

@ghost
Copy link
Author

ghost commented Mar 6, 2021

All set, thanks @zachhanson94 .
Tested 3/6/2021 on ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux-gnu]

@OscarAkaElvis
Copy link
Member

Thanks for the changes.... I'll check soon... I promise. Now busy as hell.

@OscarAkaElvis OscarAkaElvis merged commit 35d2ddc into Hackplayers:dev Mar 9, 2021
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.

2 participants