Closed bash closed 7 months ago
Sounds related to #3190, #2621, #3405.
I have no objections to setting TERM=dumb
for our PTY if that helps and doesn't have negative consequences (I can't tell, no experience with this kind of stuff).
Would you be up for making a PR?
Would you be up for making a PR?
Sure thing! I just opened #3420
Nice work here! I didn't know we could use delta inside lazygit. Do you know if we can disable side by side in delta only in lazygit? my delta config in git enables side by side by default, but I don't think it's a good visualization inside lazygit.
Do you know if we can disable side by side in delta only in lazygit?
I think "Features" might help here
[delta "lazygit"]
side-by-side = false
and then in your lazygit config add --features +lazygit
to the delta flags.
I haven't tested this though :)
Tks! Got it working, but I had to do it in the other way around:
[core]
pager = DELTA_FEATURES=+side-by-side delta
Sorry to hijack the issue here, but maybe you can shed some light on this issue I got here: https://github.com/jesseduffield/lazygit/issues/3362#issuecomment-2018905965
Hi folks 👋🏼
Background
I have recently implemented automatic color detection in delta as part of dandavison/delta#1615. This involves sending an escape sequence (
OSC 10
/OSC 11
) to the terminal and waiting for a response. Delta uses theterminal-colorsaurus
library for this.There are a couple of mechanisms in place to detect terminals that don't support this escape sequence to prevent waiting forever. Quoting myself from https://github.com/dandavison/delta/issues/1664#issuecomment-2015355094:
From what I can tell lazygit runs git (and delta) inside a PTY. This PTY however does not respond to queries (such as
OSC 10
orDA1
). It also does not identify itself via an environment variable such asTERM
or similar means.For delta this currently means that we hit the timeout which we are trying to prevent as it is the last resort mechanism.
Feature Request
Would you be open to changing lazygit's PTY to identify itself somehow?
My preferred mechanism would be setting the environment variable
TERM=dumb
[^2] sinceterminal-colorsaurus
(the library that delta uses) already detects this and other libraries / applications do too.From some preliminary testing git still starts the pager when
TERM=dumb
which seems to be the primary reason for using a PTY in the first place.[^1]: Colorsaurus sends two escape sequences: OSC 11 (the actual color querying sequence) followed by DA1 (which is supported by almost all terminals out there). Since terminals answer in the same order as the sequences were received we know that if we receive the answer to DA1 then the terminal does not support OSC 11 and can bail out early and avoid a long timeout. [^2]: It might make sense in that case to also clear out
TERM_PROGRAM
andTERM_PROGRAM_VERSION
if they exist.