Skip to content

Commit

Permalink
Drop patch for Reline 0.2.7
Browse files Browse the repository at this point in the history
The original issue in Reline has been fixed in
ruby/reline#358 and was released in Reline 0.2.8+.

Consider `debug` currently requires Reline 0.3.8+, we won't need this
patch anymore.
  • Loading branch information
st0012 authored and ko1 committed Oct 10, 2023
1 parent 840d8ad commit 4e70b17
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions lib/debug/console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,9 @@ class Console
raise LoadError if CONFIG[:no_reline]
require 'reline'

# reline 0.2.7 or later is required.
raise LoadError if Reline::VERSION < '0.2.7'

require_relative 'color'
include Color

begin
prev = trap(:SIGWINCH, nil)
trap(:SIGWINCH, prev)
SIGWINCH_SUPPORTED = true
rescue ArgumentError
SIGWINCH_SUPPORTED = false
end

# 0.2.7 has SIGWINCH issue on non-main thread
class ::Reline::LineEditor
m = Module.new do
def reset(prompt = '', encoding:)
super
Signal.trap(:SIGWINCH, nil)
end
end
prepend m
end if SIGWINCH_SUPPORTED
include Color

def parse_input buff, commands
c, rest = get_command buff
Expand Down

0 comments on commit 4e70b17

Please sign in to comment.