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

Fix default and additional key bindings vanish bug #697

Merged
merged 1 commit into from
May 2, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented May 2, 2024

When inpurc file exists, default key bindings and additional key bindings were cleared after first Reline.readline.

irb(main):001> 123 (arrow key works)
=> 123
irb(main):002> 123 (arrow key does not work)

Changes

Config#read

Changed config.read always turns @loaded to true. This will make the behavior difference of inputrc file existence small.
Even if inputrc file does not exist, we can still think null file is loaded. This will also avoid attempt loading invalid inputrc file many times.

Config#reset

Config is loaded only once and sets additional_key_bindings. We can't clear additional_key_bindings. We don't need to clear default_key_bindings too.

Copy link
Member

@ima1zumi ima1zumi left a comment

Choose a reason for hiding this comment

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

Thanks for finding and fixing this bug. 🙏

@ima1zumi ima1zumi added the bug Something isn't working label May 2, 2024
@ima1zumi ima1zumi merged commit fc9b4d2 into ruby:master May 2, 2024
40 checks passed
@tompng tompng deleted the fix_keybinding_reset branch May 2, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants