ruby / ruby/irb

IRB hangs when autocompleting require_relative path at root directory

Open
#765 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
478
Forks
158
Avg merge
1d 12h
Merged PRs (30d)
12

Description

Description

When you run irb in root directory and tries to autocomplete require_relative path, IRB hangs.
IRB tries to search every directory in your system.
In my environment, it stops after few seconds with Errno::EPERM. Similar to #606

$ cd /
$ irb
irb(main):001> require_relative 'a

Result of irb_info

irb(main):001> irb_info
Ruby version: 3.2.2
IRB version: irb 1.9.0 (2023-11-11)
InputMethod: RelineInputMethod with Reline 0.4.0
Completion: Autocomplete, RegexpCompletor
RUBY_PLATFORM: arm64-darwin22
LANG env: ja_JP.UTF-8
East Asian Ambiguous Width: 1

Terminal Emulator

Terminal.app

Setting Files

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the hang by running irb from the root directory and entering require_relative 'a. Start by tracing the autocomplete path search and its handling of the root directory and permission errors. Done means completion no longer searches indefinitely or hangs, while require_relative completion still works normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.