kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.12k stars 971 forks source link

Kitty's window misbehaviour and crash on MacOS #6454

Closed ilserd closed 1 year ago

ilserd commented 1 year ago

Describe the bug Whenever I try to move kitty from one monitor to the other, the terminal window is emptied and when I try to use the topbar's menu fields (Window in particular) it doesn't prompt anything. After executing these operations it crashes either immediately or after freezing for a while. The error seems to be related to the variations colorspace of the external monitor, although I've not achieved anything by switching both of them to "Color LCD" in the settings. However, launching the app with --config none seems to make it execute properly.

Console output

2023-07-12 12:39:08.908 kitty[3987:61904] *** Assertion failure in void set_surface_colorspace(CGSConnectionID, CGSWindowID, CGSSurfaceID, CGColorSpaceRef _Nonnull)(), NSCGLSurface.m:121
[193 12:39:26.161849] WARNING: Your system's OpenGL implementation does not have glCopyImageSubData, falling back to a slower implementation
[193 12:40:03.890731] [PARSE ERROR] The application is trying to use xterm's modifyOtherKeys. This is superseded by the kitty keyboard protocol: https://sw.kovidgoyal.net/kitty/keyboard-protocol/ the application should be updated to use that
[193 12:40:06.708865] [PARSE ERROR] The application is trying to use xterm's modifyOtherKeys. This is superseded by the kitty keyboard protocol: https://sw.kovidgoyal.net/kitty/keyboard-protocol/ the application should be updated to use that
[[[[2023-07-12 12:59:42.175 kitty[3987:61904] *** Assertion failure in void set_surface_colorspace(CGSConnectionID, CGSWindowID, CGSSurfaceID, CGColorSpaceRef _Nonnull)(), NSCGLSurface.m:121
2023-07-12 12:59:42.183 kitty[3987:61904] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'CGSSetSurfaceColorSpace failed with 1000'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007ff81267518a __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007ff81219b42b objc_exception_throw + 48
    2   Foundation                          0x00007ff81394f077 -[NSMutableDictionary(NSMutableDictionary) initWithContentsOfFile:] + 0
    3   AppKit                              0x00007ff8161be720 set_surface_colorspace + 124
    4   AppKit                              0x00007ff815d614a6 NSOpenGLContextUpdateOffScreenViewSurface + 566
    5   AppKit                              0x00007ff8159c15be -[NSOpenGLContext update] + 395
    6   kitty.glfw-cocoa.so                 0x00000001095f1f2e glfwPostEmptyEvent + 574
    7   CoreFoundation                      0x00007ff8125f36f8 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 137
    8   CoreFoundation                      0x00007ff81268c45e ___CFXRegistrationPost_block_invoke + 88
    9   CoreFoundation                      0x00007ff81268c3b3 _CFXRegistrationPost + 536
    10  CoreFoundation                      0x00007ff8125c6987 _CFXNotificationPost + 729
    11  Foundation                          0x00007ff813432b80 -[NSNotificationCenter postNotificationName:object:userInfo:] + 82
    12  AppKit                              0x00007ff8162d8c43 ___NSApplicationReactToScreenInvalidation_block_invoke + 1331
    13  AppKit                              0x00007ff8162d83cc _NSApplicationReactToScreenInvalidation + 129
    14  AppKit                              0x00007ff8157f6c12 -[NSApplication(ScreenHandling) _reactToDockChanged] + 142
    15  AppKit                              0x00007ff8157f6459 _NSCGSDockMessageReceive + 266
    16  HIToolbox                           0x00007ff81c09c71a _ZL12DockCallbackjjPvS_ + 1941
    17  HIServices                          0x00007ff817d95a4d dockClientNotificationProc + 204
    18  SkyLight                            0x00007ff81719c30c _ZN12_GLOBAL__N_123notify_datagram_handlerEj15CGSDatagramTypePvmS1_ + 1018
    19  SkyLight                            0x00007ff8174bb4ca _ZN21CGSDatagramReadStream26dispatchMainQueueDatagramsEv + 202
    20  SkyLight                            0x00007ff8174bb3f1 ___ZN21CGSDatagramReadStream15mainQueueWakeupEv_block_invoke + 18
    21  libdispatch.dylib                   0x00007ff81237fd91 _dispatch_call_block_and_release + 12
    22  libdispatch.dylib                   0x00007ff812381033 _dispatch_client_callout + 8
    23  libdispatch.dylib                   0x00007ff81238dfcf _dispatch_main_queue_drain + 954
    24  libdispatch.dylib                   0x00007ff81238dc07 _dispatch_main_queue_callback_4CF + 31
    25  CoreFoundation                      0x00007ff81263d205 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    26  CoreFoundation                      0x00007ff8125fcf2f __CFRunLoopRun + 2452
    27  CoreFoundation                      0x00007ff8125fbf31 CFRunLoopRunSpecific + 560
    28  HIToolbox                           0x00007ff81c077dad RunCurrentEventLoopInMode + 292
    29  HIToolbox                           0x00007ff81c077bbe ReceiveNextEventCommon + 657
    30  HIToolbox                           0x00007ff81c077918 _BlockUntilNextEventMatchingListInModeWithFilter + 64
    31  AppKit                              0x00007ff8156905d0 _DPSNextEvent + 858
    32  AppKit                              0x00007ff81568f47a -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1214
    33  AppKit                              0x00007ff815681ae8 -[NSApplication run] + 586
    34  kitty.glfw-cocoa.so                 0x00000001095e5c25 glfwRunMainLoop + 101
    35  kitty.fast_data_types.so            0x0000000108bd5f4d kitty.fast_data_types.so + 36685
    36  Python                              0x0000000107b83173 method_vectorcall_NOARGS + 115
    37  Python                              0x0000000107ca274c call_function + 172
    38  Python                              0x0000000107ca01df _PyEval_EvalFrameDefault + 44543
    39  Python                              0x0000000107c93f99 _PyEval_EvalCode + 537
    40  Python                              0x0000000107b750f3 _PyFunction_Vectorcall + 403
    41  Python                              0x0000000107ca274c call_function + 172
    42  Python                              0x0000000107ca02a5 _PyEval_EvalFrameDefault + 44741
    43  Python                              0x0000000107c93f99 _PyEval_EvalCode + 537
    44  Python                              0x0000000107b750f3 _PyFunction_Vectorcall + 403
    45  Python                              0x0000000107b7417f _PyObject_FastCallDictTstate + 95
    46  Python                              0x0000000107bf90bb slot_tp_call + 187
    47  Python                              0x0000000107b73ea8 _PyObject_MakeTpCall + 136
    48  Python                              0x0000000107ca27d7 call_function + 311
    49  Python                              0x0000000107ca02a5 _PyEval_EvalFrameDefault + 44741
    50  Python                              0x0000000107b7503a _PyFunction_Vectorcall + 218
    51  Python                              0x0000000107ca274c call_function + 172
    52  Python                              0x0000000107ca02a5 _PyEval_EvalFrameDefault + 44741
    53  Python                              0x0000000107b7503a _PyFunction_Vectorcall + 218
    54  Python                              0x0000000107ca274c call_function + 172
    55  Python                              0x0000000107ca02a5 _PyEval_EvalFrameDefault + 44741
    56  Python                              0x0000000107b7503a _PyFunction_Vectorcall + 218
    57  Python                              0x0000000107ca274c call_function + 172
    58  Python                              0x0000000107ca02a5 _PyEval_EvalFrameDefault + 44741
    59  Python                              0x0000000107c93f99 _PyEval_EvalCode + 537
    60  Python                              0x0000000107c8e780 builtin_exec + 384
    61  Python                              0x0000000107bd12b3 cfunction_vectorcall_FASTCALL + 99
    62  Python                              0x0000000107ca274c call_function + 172
    63  Python                              0x0000000107ca02a5 _PyEval_EvalFrameDefault + 44741
    64  Python                              0x0000000107c93f99 _PyEval_EvalCode + 537
    65  Python                              0x0000000107b750f3 _PyFunction_Vectorcall + 403
    66  Python                              0x0000000107ca274c call_function + 172
    67  Python                              0x0000000107ca02a5 _PyEval_EvalFrameDefault + 44741
    68  Python                              0x0000000107c93f99 _PyEval_EvalCode + 537
    69  Python                              0x0000000107b750f3 _PyFunction_Vectorcall + 403
    70  Python                              0x0000000107d34971 pymain_run_module + 241
    71  Python                              0x0000000107d340dc pymain_run_python + 604
    72  Python                              0x0000000107d33e37 Py_RunMain + 23
    73  kitty                               0x00000001071b7243 main + 5027
    74  kitty                               0x00000001071b643c main + 1436
    75  dyld                                0x00007ff8121c841f start + 1903
)
libc++abi: terminating due to uncaught exception of type NSException
fish: Job 1, 'kitty' terminated by signal SIGABRT (Abort)

Screenshots https://files.catbox.moe/n6k6vn.jpg

Environment details

kitty 0.29.0 (e2b5c6688d) created by Kovid Goyal
Darwin hostomel.local 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64
ProductName:        macOS ProductVersion:       13.4.1 BuildVersion:        22F82
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /usr/local/bin/fishlogin
Loaded config files:
  /Users/user/.config/kitty/kitty.conf

Config options different from defaults:
active_tab_font_style   (True, False)
allow_remote_control    yes
copy_on_select          clipboard
enabled_layouts         ['tall', 'fat', 'grid', 'horizontal', 'splits', 'stack', 'vertical']
font_size               16.0
macos_colorspace        default
macos_option_as_alt     3
strip_trailing_spaces   smart
tab_bar_style           powerline
tab_powerline_style     slanted
tab_title_template      {index}: {title}
update_check_interval   0.0
Added shortcuts:
    ctrl+opt+1 →  goto_tab 1
    ctrl+opt+2 →  goto_tab 2
    ctrl+opt+3 →  goto_tab 3
    ctrl+opt+4 →  goto_tab 4
    ctrl+opt+5 →  goto_tab 5
    ctrl+opt+6 →  goto_tab 6
    ctrl+opt+7 →  goto_tab 7
    ctrl+opt+8 →  goto_tab 8
    ctrl+opt+9 →  goto_tab 9
Changed shortcuts:
    kitty_mod+enter →  launch --cwd=current
Colors:
    active_border_color     #7287fd   
    active_tab_background   #8839ef   
    active_tab_foreground   #eff1f5   
    background              #eff1f5   
    bell_border_color       #df8e1d   
    color0                  #5c5f77   
    color1                  #d20f39   
    color10                 #40a02b   
    color11                 #df8e1d   
    color12                 #1e66f5   
    color13                 #ea76cb   
    color14                 #179299   
    color15                 #bcc0cc   
    color2                  #40a02b   
    color3                  #df8e1d   
    color4                  #1e66f5   
    color5                  #ea76cb   
    color6                  #179299   
    color7                  #acb0be   
    color8                  #6c6f85   
    color9                  #d20f39   
    cursor                  #dc8a78   
    cursor_text_color       #eff1f5   
    foreground              #4c4f69   
    inactive_border_color   #9ca0b0   
    inactive_tab_background #9ca0b0   
    inactive_tab_foreground #4c4f69   
    mark1_background        #7287fd   
    mark1_foreground        #eff1f5   
    mark2_background        #8839ef   
    mark2_foreground        #eff1f5   
    mark3_background        #209fb5   
    mark3_foreground        #eff1f5   
    selection_background    #dc8a78   
    selection_foreground    #eff1f5   
    tab_bar_background      #bcc0cc   
    url_color               #dc8a78   

Important environment variables seen by the kitty process:
    PATH                                /Applications/kitty.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin
    LANG                                it_IT.UTF-8
    SHELL                               /usr/local/bin/fishlogin
kovidgoyal commented 1 year ago

dup of #6435

ilserd commented 1 year ago

dup of #6435

Thank you for the quick reply and great work!