lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

[?1h= in display

Open mvolkmann opened this issue 2 years ago • 9 comments

Describe the bug

I see "[?1h=" in the display. See the attached screenshot with a red arrow pointing to it.

To Reproduce Steps to reproduce the behavior:

Just start lazygit in the directory of a repository that has changes.

Expected behavior

A clear and concise description of what you expected to happen.

I expect to not see those characters.

Screenshots If applicable, add screenshots to help explain your problem.

Screenshot 2023-05-10 at 8 16 30 AM

Version info: Run lazygit --version and paste the result here

commit=, build date=, build source=homebrew, version=0.37.0, os=darwin, arch=arm64, git version=2.40.0

Run git --version and paste the result here

git version 2.40.0

mvolkmann avatar May 10 '23 13:05 mvolkmann

If you are using a custom pager, please try disabling it and see if that helps.

mark2185 avatar May 10 '23 13:05 mark2185

I am using the delta pager. That was the issue. I'll report it to them.

mvolkmann avatar May 10 '23 14:05 mvolkmann

@mark2185 I also configure the use of the delta pager in my .gitconfig file. When I run git diff I do not see those extra characters. So I'm thinking this may really be an issue in lazygit. I believe those extra characters are an ANSI escape sequence to position the cursor. Is there a place in lazygit where that exact escape sequence is being output?

mvolkmann avatar May 10 '23 16:05 mvolkmann

I see that "EnterKeypad" uses that escape sequence. It is used in many "term.go" files that are part of "tcell/v2/terminfo".

mvolkmann avatar May 10 '23 16:05 mvolkmann

I've worked with the delta pager maintainer today to verify that this is not an issue with that software. I'm definitely convinced that it is not a delta issue.

mvolkmann avatar May 10 '23 20:05 mvolkmann

Oh yeah, I'm pretty sure it's due to lazygit or one of the dependencies, I just suggested to try and disable the pager to see if it's due to that, which we have now confirmed :)

mark2185 avatar May 10 '23 20:05 mark2185

That escape sequence is being printed by gocui (the rendering package that Lazygit uses). Whenever gocui comes across an escape sequence it doesn't recognise, it prints it as text.

The file this happens in is vendor/github.com/jesseduffield/gocui/escape.go. That's in the vendor directory so if somebody wants to implement support for the escape sequence, they can do so in that file for the sake of testing it out, and then make the change in https://github.com/jesseduffield/gocui so that we can then bump gocui on our end.

jesseduffield avatar May 11 '23 08:05 jesseduffield

I have the same issue when using Delta as a diff viewer and using the .gitconfig config setting. It does not happen when I configure LazyGit to use Delta in it's own config.yml. But the I loose certain setting (e.g. line numbers). Anyone a clue how I can fix this without changing gocui?

I get:

[?1h
[?1l

wlamers avatar Mar 07 '24 19:03 wlamers

I have the same issue when using Delta as a diff viewer and using the .gitconfig config setting. It does not happen when I configure LazyGit to use Delta in it's own config.yml.

I don't understand this. How are you using delta in lazygit without setting it in config.yml? This shouldn't be possible.

Can you post the relevant sections of your .gitconfig and config.yml files?

But the I loose certain setting (e.g. line numbers).

If you set delta as a pager in lazygit, you still configure it in .gitconfig. For example, I have

git:
  paging:
    colorArg: always
    pager: delta --dark --paging=never

in my config.yml, and

[delta]
	line-numbers = true

in my .gitconfig; it shows line numbers just fine in lazygit.

stefanhaller avatar Mar 07 '24 21:03 stefanhaller