[lldb-dev] [Bug 40200] New: color prompt causes wrong indentation of cmds (with `settings set prompt "\033[31m(lldb)\033[0m "`)

via lldb-dev lldb-dev at lists.llvm.org
Tue Jan 1 22:24:45 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=40200

            Bug ID: 40200
           Summary: color prompt causes wrong indentation of cmds (with
                    `settings set prompt "\033[31m(lldb)\033[0m "`)
           Product: lldb
           Version: unspecified
          Hardware: Macintosh
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: thelastmammoth at gmail.com
                CC: llvm-bugs at lists.llvm.org

~/.lldbinit:
```
settings set prompt "\033[31m(lldb)\033[0m "
```

this "almost" works, it it shows a colored prompt (red), however, it causes
wrong indentation between prompt and typed commands.

```
(lldb)          platform shell pwd
/Users/timothee/git_clone/llvm/tools/lldb
(lldb)
```

I suspect that the bug is likely caused by line editor naively counting the
number of chars in given prompt, instead of number of printable chars.

Could we allow (as workaround) user to specify actual width (and user is
responsible for specifying the correct amount of printable characters)

Where would that be in code?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20190102/c485e6fd/attachment.html>


More information about the lldb-dev mailing list