From 721b5a949e8a6c4f69eddb64c0ee72177aef80da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 22 Apr 2020 20:45:01 +0200 Subject: [PATCH] Fix 11.1.2 regression on ruby 2.7.0 on Windows 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. --- .github/workflows/windows.yml | 5 ++--- CHANGELOG.md | 4 ++++ lib/byebug/interfaces/local_interface.rb | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6583831bc..42bcc1f34 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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 @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dab399cc..ae14fdd37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/byebug/interfaces/local_interface.rb b/lib/byebug/interfaces/local_interface.rb index 9996e3a4b..094dff5fa 100644 --- a/lib/byebug/interfaces/local_interface.rb +++ b/lib/byebug/interfaces/local_interface.rb @@ -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