Package: irb1.8
Version: 1.8.4-3
Severity: minor

Hi

I configured irb to use a colored prompt using escape codes. But it seems
to calculate the terminal width using the size of the prompt string, so the
width is too short (e.g. in a 80x25 terminal the line breaks after 70 chars,
and then continues at the beginning of the same line, writing over the prompt
and already entered text.

I guess escape codes should be stripped first, or maybe readline already
has support for this? The same thing works fine with ipython, which also
uses readline and has a colored prompt.

Here's the relevant part from .irbrc (replace ^[ with escapes):

IRB.conf[:IRB_RC] = proc do |conf|
  leader = " " * (conf.irb_name.length + conf.workspace.main.to_s.length + 3)
  conf.prompt_i = "%N[%m] ^[[1;34m>>>^[[0m "
  conf.prompt_s = leader + " ^[[1;32m..^[[0m "
  conf.prompt_n = conf.prompt_c = "%N[%m]  ^[[1;32m..^[[0m "
  conf.return_format = " ^[[1;31m::^[[0m %s\n"
end


Cheers,
Markus


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (100, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16
Locale: LANG=C, LC_CTYPE=de_CH (charmap=ISO-8859-1)

Versions of packages irb1.8 depends on:
ii  libreadline-ruby1.8           1.8.4-3    Readline interface for Ruby 1.8
ii  ruby1.8                       1.8.4-3    Interpreter of object-oriented scr

irb1.8 recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to