summaryrefslogtreecommitdiff
path: root/lib/reline/unicode.rb
diff options
context:
space:
mode:
authortomoya ishida <[email protected]>2023-03-29 15:54:03 +0900
committergit <[email protected]>2023-03-29 06:54:08 +0000
commite26908dc4b6604cfe3c89f4cdc75dab67dff7d03 (patch)
treeecd6967e12a6281a4c1a996247b0e58a132c9b16 /lib/reline/unicode.rb
parent8c8d0680161c9671e68303ee2b27ccbea4bd293a (diff)
[ruby/reline] Improve OSC sequence regexp. OSC sequence can end with
ST(ESC\) and it should not to include \a and \e inside. (https://github.com/ruby/reline/pull/527) https://github.com/ruby/reline/commit/a88052adec
Diffstat (limited to 'lib/reline/unicode.rb')
-rw-r--r--lib/reline/unicode.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/reline/unicode.rb b/lib/reline/unicode.rb
index 1f0f6432c8..29c13811cd 100644
--- a/lib/reline/unicode.rb
+++ b/lib/reline/unicode.rb
@@ -38,7 +38,7 @@ class Reline::Unicode
NON_PRINTING_START = "\1"
NON_PRINTING_END = "\2"
CSI_REGEXP = /\e\[[\d;]*[ABCDEFGHJKSTfminsuhl]/
- OSC_REGEXP = /\e\]\d+(?:;[^;]+)*\a/
+ OSC_REGEXP = /\e\]\d+(?:;[^;\a\e]+)*(?:\a|\e\\)/
WIDTH_SCANNER = /\G(?:(#{NON_PRINTING_START})|(#{NON_PRINTING_END})|(#{CSI_REGEXP})|(#{OSC_REGEXP})|(\X))/o
def self.get_mbchar_byte_size_by_first_char(c)