Skip to content

Commit

Permalink
Fix 11.1.2 regression on ruby 2.7.0 on Windows (#674)
Browse files Browse the repository at this point in the history
By default ruby 2.7.0 on Windows comes with rb-readline, which doesn't
like `nil` completion procs, and with a version of `irb` that installs
its own completion proc.

That combination causes `byebug` to crash.

Installing a dummy "nil proc" seems like the most compatible thing to
do.
  • Loading branch information
deivid-rodriguez committed Apr 23, 2020
1 parent 27f84f6 commit 2d43b0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/windows.yml
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
version: [2.4.9, 2.5.7, 2.6.5, head]
version: [2.4.9, 2.5.7, 2.6.5, 2.7.0, head]

steps:
- uses: actions/checkout@v2
Expand All @@ -33,8 +33,7 @@ jobs:
run: |
git clone -q --depth=5 --no-tags --branch=byebug https://github.com/deivid-rodriguez/rb-readline.git C:\rb-readline
$n_dir = $(ruby -e "print RbConfig::CONFIG['sitelibdir']")
Copy-Item -Path C:\rb-readline\lib\readline.rb -Destination $n_dir\readline.rb
Copy-Item -Path C:\rb-readline\lib\rbreadline.rb -Destination $n_dir\rbreadline.rb
Copy-Item -Path C:\rb-readline\lib\* -Destination $n_dir -Recurse
- name: Setup dependencies
shell: bash
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Fixed

* [#674](https://github.com/deivid-rodriguez/byebug/pull/674): crash when using byebug on ruby 2.7.0 on Windows.

## [11.1.2] - 2020-04-17

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion lib/byebug/interfaces/local_interface.rb
Expand Up @@ -53,7 +53,7 @@ def without_readline_completion
return yield unless orig_completion

begin
Readline.completion_proc = nil
Readline.completion_proc = ->(_) { nil }
yield
ensure
Readline.completion_proc = orig_completion
Expand Down

0 comments on commit 2d43b0c

Please sign in to comment.