On 12/17/13 9:59 AM, Jinesh Choksi wrote: > Bash Version: 4.2 > Patch Level: 45 > Release Status: release > > Description: > The simplest PS1 prompt which demonstrates the issue is: > > PS1="\[\033[01;31m\]Hello world\n\u@\h:\[\033[01;32m\]\w\$\[\033[00m\] " > > The issue is that a lengthy current working directory gets split up before > the width of the terminal is reached. > > This happens only when colour sequences are used. When no colour sequences > are used, the prompt works correctly.
This is the result of the \n in the prompt, believe it or not. I have attached a patch, and the patch will be in bash-4.3/readline-6.3. I would appreciate as many people as possible testing it. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/
*** /fs2/chet/bash/bash-20131219/lib/readline/display.c 2013-10-14 09:25:44.000000000 -0400 --- lib/readline/display.c 2013-12-27 13:10:56.000000000 -0500 *************** *** 749,756 **** /* XXX - this assumes that the invisible characters may be split, but only between the first and the last lines. */ ! temp += ((local_prompt_prefix == 0) ? ((newlines == 0) ? prompt_invis_chars_first_line ! : ((newlines == prompt_lines_estimate) ? wrap_offset : prompt_invis_chars_first_line)) ! : ((newlines == 0) ? wrap_offset : 0)); ! inv_lbreaks[++newlines] = temp; #if defined (HANDLE_MULTIBYTE) --- 749,755 ---- /* XXX - this assumes that the invisible characters may be split, but only between the first and the last lines. */ ! temp += (newlines == 0) ? prompt_invis_chars_first_line ! : ((newlines == prompt_lines_estimate) ? wrap_offset : prompt_invis_chars_first_line); ! inv_lbreaks[++newlines] = temp; #if defined (HANDLE_MULTIBYTE)