Describe the bug
After recently upgrading to macOS Big Sur (version 11.0.1), I am no longer able to toggle the traditional macOS fullscreen functionality that Kitty has previously supported with macos_traditional_fullscreen.
My full Kitty configuration is available here for reference.
To Reproduce
Steps to reproduce the behavior:
kitty.conf to:macos_traditional_fullscreen yes
kitty_mod cmd
map kitty_mod+enter toggle_fullscreen
Expected behavior
Before the macOS upgrade, the same steps would have made the terminal fullscreen which I would have expected it to still do.
Environment details
OS: macOS Big Sur (version 11.0.1).
Output of kitty --debug-config
kitty 0.19.2 created by Kovid Goyal
Darwin libris.local 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:11 PDT 2020; root:xnu-7195.50.7~2/RELEASE_X86_64 x86_64
ProductName: macOS ProductVersion: 11.0.1 BuildVersion: 20B29
Loaded config files: /Users/mathias/.config/kitty/kitty.conf
Config options different from defaults:
kitty_mod 8
macos_traditional_fullscreen True
Changed shortcuts:
super+enter KeyAction(func='toggle_fullscreen', args=())
Thank you for your great work on not only Kitty but also Calibre.
Not sure what I can do about it. Since traditional fullscreen was legacy
presumably Apple broke/removed it in Big Sur. However, I am far from a
an expert on Cocoa, so if someone knows of a workaround patches are most
welcome.
I fired up the iTerm beta and its "non-native" fullscreen works, so it is still possible. I'm not sure how it has been implemented though and couldn't find anything relevant in their Big Sur tracking issue.
Thank you for your swift reply!
I am glad to hear that iTerm2 still supports it. Hopefully, this means that it can eventually be supported in Kitty again.
Unfortunately, I do not have the skills necessary to fix this bug myself, but I'll cross my fingers that somebody else does.
For reference, in kitty, this is implemented in _glfwPlatformToggleFullscren() in glfw/cocoa_window.m
And if you run kitty from another terminal, you get an error about NSWindowStyleMaskFullscreen set outside of a full screen transition printed. So yes, apple have deliberately disabled going fullscreen like this.
And here is the iterm implementation. https://github.com/gnachman/iTerm2/blob/75b2165fe62f45043dbe59c9e38d018bd82e7f15/sources/PseudoTerminal%2BWindowStyle.m#L517
it basically just manually resizes the window and hides the chrome, simulating fullscreen, as far as I can tell.
I have committed code to just resize the window to the full screen and remove its chrome. That works on Big Turd, however, for some reason the window doesnt get keyboard focus till you click on it, and I cant figure out why. Calling makeKey even after a delay seems to have no effect. Presumably some bug in dealing with chromeless windows in macOS.
Thank you so much for taking the time to look at this so quickly. What would be the easiest way to get these changes until a new version of Kitty is released?
Fantastic. It seems to work perfectly. It would definitely be nice if the window would receive keyboard focus automatically but this solves the main issue.
Thank you so much for your help. I greatly appreciate it!
You're welcome
Most helpful comment
I have committed code to just resize the window to the full screen and remove its chrome. That works on Big Turd, however, for some reason the window doesnt get keyboard focus till you click on it, and I cant figure out why. Calling makeKey even after a delay seems to have no effect. Presumably some bug in dealing with chromeless windows in macOS.