IRB leaking out Reline changes globally
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 478
- Forks
- 158
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 12
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided IRB.start and Reline.readline sequence, then trace how IRB changes Reline state during and after the session. Compare Reline settings before and after quitting IRB, including autocompletion and core state. Done means the original Reline settings remain unchanged after IRB.start returns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100