[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 24 07:34:41 PDT 2020


labath added a comment.

In D81001#2172035 <https://reviews.llvm.org/D81001#2172035>, @labath wrote:

> In D81001#2171999 <https://reviews.llvm.org/D81001#2171999>, @gedatsu217 wrote:
>
> > > That said, are you sure this is the right sequence? \x1b[1Gl seems like it should print the l at column one, which does not sound right...
> >
> > I thought it did not add up too, but pexpect probably actually outputs these characters.
> >
> > > The sequence I got in this test was l\x1b[2mp frame\x1b[0m\x1b[1G\r\x1b[9Cl, which seems more believable.
> >
> > It did not go well...  However,  `"l" + faint_color + "p frame" + reset + "\x1b[1G" + "l"` passed the test.
> >  This test ensure that the cursor is behind "l", but I do not understand what role "\x1b[1G" plays...
> >
> > What do you think about this test?
>
>
> I think it won't pass on my machine because that's not the sequence I am getting. :(
>
> I can see how different libedit versions could produce different sequences, but I do not understand how can the one you're seeing be "right".
>
> Are you testing this on a mac? Lemme try what I get there...


Ok, so I was able to confirm what you are seeing on a mac. I don't fully understand what is happening but the problem is related to the use-color setting. Our pexpect harness starts lldb with colors disabled, and this seems to be causing lldb (or libedit) to go berserk. Indeed if you start lldb without colors manually (`lldb --no-use-color`), you will see that this feature (on a mac) misbehaves -- the cursor gets moved to the first column just like we expected based on the ansi sequences. On linux everything seems to be working fine even without colors.

Now the question is what to do about it? Did you actually intend for your feature to work with colors disabled? If yes, then we'll need to figure out why things don't work on a mac. If no, then we'll need to customize our test harness to enable launching lldb with colors for the autosuggestion tests. And then we'll need to find the right sequence to expect...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81001/new/

https://reviews.llvm.org/D81001





More information about the lldb-commits mailing list