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

IRB leaking out Reline changes globally #1048

Open
szymonj99 opened this issue Dec 13, 2024 · 0 comments
Open

IRB leaking out Reline changes globally #1048

szymonj99 opened this issue Dec 13, 2024 · 0 comments

Comments

@szymonj99
Copy link

Description

Calling to IRB.start results in IRB leaking out Reline changes globally.

Minimal Reproducible Example

require 'reline'
require 'irb'

::Reline.autocompletion = false

line = ::Reline.readline('PROMPT >> ', false)

IRB.start

line = ::Reline.readline('PROMPT >> ', false)

Current Workaround

I'm unsure if there's any other potential settings being changed. Here's what I have so far:

config = { autocompletion: Reline.autocompletion, core: Reline.core.dup }
IRB.start
Reline.autocompletion = config[:autocompletion]
Reline.instance_variable_set(:@core, @current_config[:core])

Expected Behaviour

I would expect that changes to Reline performed by IRB do not persist after quitting out of the IRB session.
My Reline changes and settings should remain what the were before and after.

Result of irb_info

irb(main):001> irb_info
Ruby version: 3.3.6
IRB version: irb 1.14.1 (2024-09-25)
InputMethod: RelineInputMethod with Reline 0.5.12
Completion: Autocomplete, RegexpCompletor
RUBY_PLATFORM: x86_64-linux
LANG env: en_GB.UTF-8
East Asian Ambiguous Width: 1

Terminal Emulator

Konsole. This happens on a Mac as well with the default terminal.

Setting Files

Are you using ~/.irbrc and ~/.inputrc?
-> No

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

No branches or pull requests

1 participant