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

Escape autocompletion word before putting it into Regexp #498

Merged
merged 1 commit into from
Feb 5, 2022

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Jan 21, 2022

Fixes #497

The issue is caused by special characters be converted into the autocompletion's RegExp directly, like /\Aargs[/.
It can be reproduced by typing args[ and tab to trigger the completion callback:

❯ exe/rdbg target.rb
[1, 1] in target.rb
=>   1| a = 1
=>#0    <main> at target.rb:1
(rdbg) args[#<Thread:0x00007fa74da10c60@DEBUGGER__::SESSION@server /Users/st0012/projects/debug/lib/debug/session.rb:147 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        29: from /Users/st0012/projects/debug/lib/debug/session.rb:167:in `block in activate'
        28: from /Users/st0012/projects/debug/lib/debug/session.rb:197:in `session_server_main'
        27: from /Users/st0012/projects/debug/lib/debug/session.rb:253:in `process_event'
        26: from /Users/st0012/projects/debug/lib/debug/session.rb:331:in `wait_command_loop'
        25: from /Users/st0012/projects/debug/lib/debug/session.rb:331:in `loop'
        .....

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

Successfully merging this pull request may close these issues.

Console crashes "premature end of char-class"
2 participants