From 89bc139623babee468ebd8912f4d5d247a506571 Mon Sep 17 00:00:00 2001 From: tompng Date: Thu, 28 Sep 2023 02:29:05 +0900 Subject: [PATCH] GeneralIO.reset should reset class variable existence --- lib/reline/general_io.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/reline/general_io.rb b/lib/reline/general_io.rb index dd2e87eaf0..eaae63f925 100644 --- a/lib/reline/general_io.rb +++ b/lib/reline/general_io.rb @@ -3,7 +3,11 @@ class Reline::GeneralIO def self.reset(encoding: nil) @@pasting = false - @@encoding = encoding + if encoding + @@encoding = encoding + elsif defined?(@@encoding) + remove_class_variable(:@@encoding) + end end def self.encoding