mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 13:34:17 +02:00
[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)
a88052adec
This commit is contained in:
parent
8c8d068016
commit
e26908dc4b
2 changed files with 12 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue