Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent colors in scrollback mode #2381

Closed
notpeelz opened this issue Feb 19, 2020 · 12 comments
Closed

Inconsistent colors in scrollback mode #2381

notpeelz opened this issue Feb 19, 2020 · 12 comments

Comments

@notpeelz
Copy link

Colors render differently with scrollback mode enabled:
scrollback_colors

Kitty version: 0.14.6
OS: NixOS 19.09 x86_64 (Linux 5.4.15)
Shell: zsh 5.7.1
DE: xsession (no DE)
WM: bspwm

Config: kitty.conf

@kovidgoyal
Copy link
Owner

I cannot reproduce using the default scrollback pager, less and the default kitty.conf and kitty from master. If you can come up with a minimal kitty.conf and set of steps to reproduce with kitty 0.16 or kitty from master, update this issue and I will re-open.

@trygveaa
Copy link
Sponsor Contributor

I can reproduce it without a kitty.conf and kitty from master by running ls -1 in the kitty repo and pressing kitty_mod+h.

Normal:
shot_2020-02-24_19-19-43_491x843

Scrollback pager:
shot_2020-02-24_19-19-47_491x843

@trygveaa
Copy link
Sponsor Contributor

I tried without .zshrc now and the problem disappeared. Will investigate further.

@trygveaa
Copy link
Sponsor Contributor

For some reason I can't reproduce it with ls anymore, even after reinstating my config.

But I can reproduce it by running git log -p in the kitty repo and then pressing kitty_mod+h, without kitty.conf or .zshrc.

@kovidgoyal
Copy link
Owner

Does not reproduce for me with

kitty --config NONE git log -p

and pressing ctrl+shift+h

check your environment variables.

@trygveaa
Copy link
Sponsor Contributor

trygveaa commented Feb 25, 2020

It still happens for me with 2d870fc. I tried removing environment variables such as LESS and PAGER, and running kitty --config NONE git log -p.

These are the environment variables that are left:

Click to expand
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DESKTOP_STARTUP_ID=awesome/kitty/596-0-george_TIME125199
DISPLAY=:0
EDITOR=vim
HOME=/home/trygve
KITTY_WINDOW_ID=365
LANG=en_US.UTF-8
LC_ADDRESS=nb_NO.UTF-8
LC_COLLATE=nb_NO.UTF-8
LC_CTYPE=nb_NO.UTF-8
LC_IDENTIFICATION=nb_NO.UTF-8
LC_MEASUREMENT=nb_NO.UTF-8
LC_MONETARY=nb_NO.UTF-8
LC_NAME=nb_NO.UTF-8
LC_NUMERIC=nb_NO.UTF-8
LC_PAPER=nb_NO.UTF-8
LC_TELEPHONE=nb_NO.UTF-8
LC_TIME=nb_NO.UTF-8
LOGNAME=trygve
MAIL=/var/spool/mail/trygve
OLDPWD=/home/trygve
PATH=/home/trygve/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:./node_modules/.bin:/home/trygve/.yarn/bin
PWD=/home/trygve/dev/kitty
SHELL=/usr/bin/zsh
SHLVL=2
TERMINFO=/usr/lib/kitty/terminfo
TERM=xterm-kitty
USER=trygve
_=/usr/bin/env
WINDOWID=6293051
WINDOWPATH=1
XAUTHORITY=/home/trygve/.Xauthority
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_CLASS=user
XDG_SESSION_ID=1
XDG_SESSION_TYPE=tty
XDG_VTNR=1

@trygveaa
Copy link
Sponsor Contributor

trygveaa commented Feb 25, 2020

I bisected the issue to commit bd3f0b5.

Edit: Or 297963f is more relevant I guess. It happens with those two (but not the one between them, 6fae354).

@kovidgoyal
Copy link
Owner

Can you run kitty --dump-bytes and post the dump with some minimal git log -p output that shows the issue. I dont see anything wrong with either of those two commits.

@kovidgoyal
Copy link
Owner

Oh and the terminal size you used when generating the dump is probably also relevant.

@trygveaa
Copy link
Sponsor Contributor

Here it is. The terminal size when running this was 50x80 and I ran it with ./kitty/launcher/kitty --dump-bytes kitty-color-issue-dump.txt --config NONE git log -p -2 2d870fc8~
kitty-color-issue-dump.txt

@trygveaa
Copy link
Sponsor Contributor

Here is a minimal text which reproduces the issue for me when cat-ing it:

�[32mgreen�[0m
�[32mgreen�[0m

Here it is as an attached file, including some other combinations of colors. This is what it looks like here:

Normal mode:
shot_2020-02-25_13-56-50_325x305

Scrollback mode:
shot_2020-02-25_13-56-54_325x305

So the issue seems to be that if a line ends with some color or attributes and the next line starts by setting the same, they won't be set.

@trygveaa
Copy link
Sponsor Contributor

Oh, so it was a bug in less.

Thanks for fixing it! I can confirm that it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants