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

Broken rendering and UnboundLocalError #2896

Closed
akobel opened this issue Aug 3, 2020 · 4 comments
Closed

Broken rendering and UnboundLocalError #2896

akobel opened this issue Aug 3, 2020 · 4 comments
Labels

Comments

@akobel
Copy link
Contributor

akobel commented Aug 3, 2020

Describe the bug
Since kitty 0.18.2, roughly 90% of the time kitty complains about UnboundLocalError: local variable 'boss' referenced before assignment and renders ugly characters until I resize or change the window geometry. It's specific to my low-dpi screen, though; see "environment" below.

To Reproduce
Just kitty.

Expected behavior
Just kitty as I know her... ;-)

Screenshots
Left terminal: fine rendering after resizing to half the screen, which changes the window geometry.
Right terminal: borken fonts.
20200803_18h34m02s_grim

Environment details
Arch Linux, all up-to-date, with kitty 0.18.2 from the repos. Same with kitty straight from git.
Sway on Wayland, on a dual-screen setup; high-dpi screen with scale=2 is perfectly good, the classic low-dpi monitor with scale=1 is the troublemaker.

kitty 0.18.2 created by Kovid Goyal
Linux x1c 5.7.11-zen1-1-zen #1 ZEN SMP PREEMPT Wed, 29 Jul 2020 21:39:59 +0000 x86_64
Arch Linux \r (\l)
Loaded config files: /home/akobel/.config/kitty/kitty.conf
Running under: Wayland

Config options different from defaults:
active_border_color     Color(red=146, green=128, blue=128)
active_tab_background   Color(red=36, green=24, blue=40)
active_tab_foreground   Color(red=19, green=153, blue=19)
allow_remote_control    y
background              Color(red=0, green=21, blue=20)
bell_border_color       Color(red=186, green=138, blue=0)
close_on_child_death    True
color0                  Color(red=0, green=21, blue=20)
color1                  Color(red=250, green=51, blue=51)
color10                 Color(red=58, green=167, blue=58)
color11                 Color(red=186, green=138, blue=0)
color12                 Color(red=136, green=135, blue=240)
color13                 Color(red=216, green=92, blue=242)
color14                 Color(red=29, green=161, blue=175)
color15                 Color(red=162, green=159, blue=160)
color2                  Color(red=19, green=153, blue=19)
color3                  Color(red=158, green=129, blue=0)
color4                  Color(red=85, green=127, blue=235)
color5                  Color(red=213, green=76, blue=191)
color6                  Color(red=0, green=149, blue=128)
color7                  Color(red=146, green=128, blue=128)
color8                  Color(red=36, green=24, blue=40)
color9                  Color(red=240, green=104, blue=26)
cursor                  Color(red=162, green=159, blue=160)
cursor_text_color       Color(red=0, green=21, blue=20)
disable_ligatures       2
enable_audio_bell       False
font_family             AK UI Terminal
font_size               10.0
foreground              Color(red=162, green=159, blue=160)
inactive_border_color   Color(red=36, green=24, blue=40)
inactive_tab_background Color(red=0, green=21, blue=20)
inactive_tab_foreground Color(red=146, green=128, blue=128)
selection_background    Color(red=162, green=159, blue=160)
selection_foreground    Color(red=0, green=21, blue=20)
url_color               Color(red=85, green=127, blue=235)
visual_bell_duration    0.05
Added shortcuts:
	shift+page_up KeyAction(func='scroll_page_up', args=())
	shift+page_down KeyAction(func='scroll_page_down', args=())

(AK UI Terminal is a fontconfig-alias for Source Code Pro Regular, but the same issue happens with DejaVu Sans Mono or other fonts.)

Additional context
None of the above seems to matter except font_size 10. In fact, this seems to be the minimal kitty.conf to reproduce the problem.

@akobel akobel added the bug label Aug 3, 2020
@kovidgoyal
Copy link
Owner

Post the full traceback for that error.

@kovidgoyal
Copy link
Owner

Never mind I see its in your screenshot

@akobel
Copy link
Contributor Author

akobel commented Aug 3, 2020

Whoa, that was swift.

kitty --debug-rendering
GL version string: '4.6 (Core Profile) Mesa 20.1.4' Detected version: 4.6
Traceback (most recent call last):
  File "/usr/bin/../lib/kitty/kitty/boss.py", line 502, in on_window_resize
    self.on_dpi_change(os_window_id)
  File "/usr/bin/../lib/kitty/kitty/boss.py", line 593, in on_dpi_change
    tm.resize()
  File "/usr/bin/../lib/kitty/kitty/tabs.py", line 582, in resize
    tab.relayout()
  File "/usr/bin/../lib/kitty/kitty/tabs.py", line 193, in relayout
    self.current_layout(self.windows)
  File "/usr/bin/../lib/kitty/kitty/layout/base.py", line 310, in __call__
    self.do_layout(all_windows)
  File "/usr/bin/../lib/kitty/kitty/layout/tall.py", line 127, in do_layout
    self.layout_single_window_group(next(all_windows.iter_all_layoutable_groups()))
  File "/usr/bin/../lib/kitty/kitty/layout/base.py", line 323, in layout_single_window_group
    wg.set_geometry(geom)
  File "/usr/bin/../lib/kitty/kitty/window_list.py", line 100, in set_geometry
    w.set_geometry(geom)
  File "/usr/bin/../lib/kitty/kitty/window.py", line 394, in set_geometry
    boss.child_monitor.resize_pty(self.id, *current_pty_size)
UnboundLocalError: local variable 'boss' referenced before assignment

is what you mean? Sorry, should have included that.

Of course, not sure whether another package is the culprit, which was updated along with the update for kitty...

@akobel
Copy link
Contributor Author

akobel commented Aug 3, 2020

Magic. Thanks a ton - confirmed on maybe 50 tests, didn't occur again.

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