Class | String |
In: |
lib/rhc/core_ext.rb
|
Parent: | Object |
ANSI_ESCAPE_SEQUENCE | = | /\e\[(\d{1,2}(?:;\d{1,2})*[@-~])/ |
ANSI_ESCAPE_MATCH | = | '\e\[\d+(?:;\d+)*[@-~]' |
CHAR_SKIP_ANSI | = | "(?:(?:#{ANSI_ESCAPE_MATCH})+.?|.(?:#{ANSI_ESCAPE_MATCH})*)" |
Split the given string at limit, treating ANSI escape sequences as zero characters in length. Will insert an ANSI reset code (\e[0m) at the end of each line containing an ANSI code, assuming that a reset was not in the wrapped segment.
All newlines are preserved.
Lines longer than limit without natural breaks will be forcibly split at the exact limit boundary.
Returns an Array