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

Quickly resizing Kitty squashes the text #3307

Closed
omentic opened this issue Feb 12, 2021 · 12 comments
Closed

Quickly resizing Kitty squashes the text #3307

omentic opened this issue Feb 12, 2021 · 12 comments
Labels

Comments

@omentic
Copy link

omentic commented Feb 12, 2021

Describe the bug
Slowly resizing kitty squashes the text and creates font clipping issues. These persist while interacting with the terminal, until it's resized once again.

To Reproduce
Steps to reproduce the behavior:

  1. Launch kitty, and output text onto the console. (I used neofetch).
  2. Shrink kitty vertically abruptly.
  3. If this fails to cause the error, try kinda wiggling it up and down while resizing.
  4. See error.

Expected behavior
kitty should cut off text in the terminal, not squashing it to fit the viewport.

Screenshots

Before resizing:
2021-02-11-222916

Erroneous behavior:
2021-02-11-222904

Expected behavior:
2021-02-11-223458

Environment details
OS: Linux 5.10.15
kitty: 0.19.3

Additional context
Reproducible with kitty --config NONE.

@omentic omentic added the bug label Feb 12, 2021
@kovidgoyal
Copy link
Owner

Doesn't reproduce for me, on Linux with either i3 (X11) or weston
(Wayland). What is bspwm? Does it use X11 or Wayland?

@omentic
Copy link
Author

omentic commented Feb 12, 2021

bspwm is an Xorg-based window manager pretty similar to i3.

I just tested with a clean install of kitty on my desktop running Wayland and Sway, and I can actually reproduce it there too. I'll try to see if I can capture a screen recording.

@omentic
Copy link
Author

omentic commented Feb 12, 2021

recording.mp4

@kovidgoyal
Copy link
Owner

Hmm still cant repro even with bspwm. Are you willing to run from source and help debug? If so, look in glfw.c the relevant functions are live_resize_callback, framebuffer_size_callback and update_os_window_viewport. The last one should be called after resizing is done ad is responsible for changing the actual size of the terminal window (cell area)

@omentic
Copy link
Author

omentic commented Feb 13, 2021

Sure thing. Is there a special debug configuration you'd like me to compile it with?

@kovidgoyal
Copy link
Owner

Just make debug https://sw.kovidgoyal.net/kitty/build.html

@omentic
Copy link
Author

omentic commented Feb 13, 2021

[043 21:12:31.693228] Ignoring resize request for tiny size: 603x99
[043 21:12:31.728550] Ignoring resize request for tiny size: 602x94
[043 21:12:31.772924] Invalid geometry ignored: framebuffer: 602x94 window: 602x94

[043 21:12:31.800309] Ignoring resize request for tiny size: 602x92
[043 21:12:31.821168] Ignoring resize request for tiny size: 601x89
[043 21:12:31.842374] Ignoring resize request for tiny size: 600x85
[043 21:12:31.878028] Ignoring resize request for tiny size: 599x85
[043 21:12:32.199041] Ignoring resize request for tiny size: 599x86
[043 21:12:32.241185] Ignoring resize request for tiny size: 599x88
[043 21:12:32.262955] Ignoring resize request for tiny size: 599x90
[043 21:12:32.284258] Ignoring resize request for tiny size: 599x93
[043 21:12:32.312620] Ignoring resize request for tiny size: 599x97
[043 21:12:36.243009] Ignoring resize request for tiny size: 557x98
[043 21:12:36.270214] Ignoring resize request for tiny size: 555x96
[043 21:12:36.291623] Ignoring resize request for tiny size: 554x95
[043 21:12:36.320119] Ignoring resize request for tiny size: 553x93
[043 21:12:36.330460] Invalid geometry ignored: framebuffer: 553x93 window: 553x93

[043 21:12:36.341362] Ignoring resize request for tiny size: 553x92
[043 21:12:36.362902] Ignoring resize request for tiny size: 552x92
[043 21:12:36.406029] Ignoring resize request for tiny size: 552x91
[043 21:12:36.597922] Ignoring resize request for tiny size: 551x91
[043 21:12:36.876299] Ignoring resize request for tiny size: 551x90
[043 21:12:36.910861] Ignoring resize request for tiny size: 551x92
[043 21:12:36.932416] Ignoring resize request for tiny size: 551x93
[043 21:12:36.954361] Ignoring resize request for tiny size: 551x95
[043 21:12:36.989573] Ignoring resize request for tiny size: 551x99

The "Ignoring resize request"s come whenever I resize it to be small, while the "Invalid geometry ignored"s line up with the text getting squooshed. Occasionally the text gets squooshed without logging an "Invalid geometry ignored".

It also happens when resizing Kitty horizontally.
2021-02-12-211550

@omentic
Copy link
Author

omentic commented Feb 13, 2021

With --dump-commands, some more stuff comes up:

[043 21:20:25.541597] Ignoring resize request for tiny size: 613x99
[043 21:20:25.581500] Invalid geometry ignored: framebuffer: 613x99 window: 613x99 <====== when the font becomes squooshed

[043 21:20:25.598485] Ignoring resize request for tiny size: 613x98
[043 21:20:25.647900] Ignoring resize request for tiny size: 613x96
[043 21:20:25.726186] Ignoring resize request for tiny size: 613x95
[043 21:20:25.761599] Ignoring resize request for tiny size: 613x94
[043 21:20:27.446241] Ignoring resize request for tiny size: 613x95
[043 21:20:27.510682] Ignoring resize request for tiny size: 613x96
[043 21:20:27.553203] Ignoring resize request for tiny size: 613x97
[043 21:20:27.588615] Ignoring resize request for tiny size: 613x98
[043 21:20:27.816156] Ignoring resize request for tiny size: 613x99
screen_carriage_return <====== when the font becomes unsquooshed
screen_erase_in_line 0 0
select_graphic_rendition 1 
select_graphic_rendition 32 
draw [teal@endeavour
select_graphic_rendition 1 
select_graphic_rendition 37 
draw  kitty
select_graphic_rendition 1 
select_graphic_rendition 32 
draw ]$
select_graphic_rendition 0 
draw 

@kovidgoyal
Copy link
Owner

the invalid geometry ignored errors will happen because of aspect ratio
limits, try increasing those limits and see if the problem goes away in
line 49 of glfw.c

@kovidgoyal
Copy link
Owner

And does this happen only when resizing to less than 100px wide/high?

@omentic
Copy link
Author

omentic commented Feb 13, 2021

Looks like it, yes. Decreasing min_width and min_height made it only happen for smaller and smaller windows.

(I'm not sure exactly what the aspect ratio limits are, but changing fw / w > 5 and fh / h > 5 didn't do anything)

@omentic
Copy link
Author

omentic commented Feb 14, 2021

I do still see this behavior, but only for ridiculously small terminal sizes. Thanks for the quick turnaround.

2021-02-14-123728

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

No branches or pull requests

2 participants