Class: RawLine::Prompt

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/rawline/prompt.rb

Instance Method Summary collapse

Instance Method Details

#lengthObject

Length returns the length of the prompt minus any ANSI escape sequences.



7
8
9
# File 'lib/rawline/prompt.rb', line 7

def length
  self.gsub(/\033\[[0-9;]*m/, "").length
end