On 2/4/18 10:09 AM, Alexander Kozlenkov wrote: > I bracketed \[ and \] each prompt variables and simple symbols and line > break does work right. > Example: >> \[\e[1;32m\]\u\[\e[m\]\[\e[1;32m\]@\[\e[m\]\[\e[1;32m\]\h\[\e[m\] > But if I bracketed sequences some symbols, line break does not work . > Example: >> \[\e[1;32m\]\u@\h\[\e[m\]
You need to identify non-printing sequences so readline knows the visible length of the prompt and can accurately calculate the cursor position. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/