diff options
author | Kyrylo Silin <silin@kyrylo.org> | 2021-03-28 00:54:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-28 00:54:54 +0200 |
commit | 033f69b3afcce57ed8d8b68f297457d1a80b1e6c (patch) | |
tree | b070de1852c7ca872e038b73179b21775829a155 /lib | |
parent | 438ce376b0b0f1ca501d6a712d1b26ca0dde5c15 (diff) | |
parent | 8e8f2d53d6972e3a96fd0c63b64b9e626d438b83 (diff) | |
download | pry-033f69b3afcce57ed8d8b68f297457d1a80b1e6c.tar.gz |
Merge pull request #2158 from andrehjr/fix-color-off-overwrite
Fix breakage in output with colors disabled
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pry/helpers/text.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pry/helpers/text.rb b/lib/pry/helpers/text.rb index b7301e99..e004c961 100644 --- a/lib/pry/helpers/text.rb +++ b/lib/pry/helpers/text.rb @@ -44,7 +44,7 @@ class Pry # @param [String, #to_s] text # @return [String] _text_ stripped of any color codes. def strip_color(text) - text.to_s.gsub(/(\001)?\e\[.*?(\d)+m(\002)?/, '') + text.to_s.gsub(/(\001)?(\e\[(\d[;\d]?)*m)(\002)?/, '') end # Returns _text_ as bold text for use on a terminal. |