FelixKratz / SketchyBar

A highly customizable macOS status bar replacement
https://felixkratz.github.io/SketchyBar/
GNU General Public License v3.0
5.25k stars 82 forks source link

ABORT when using `app.$INFO` for the front app on certain windows #442

Closed crisidev closed 8 months ago

crisidev commented 8 months ago

If I use the latest released version sketchybar-v2.19.2 and use the new functionality to get the bundle ID directly from sketchybar like

sketchybar --set $NAME label="$INFO" icon.background.image="app.$INFO"

I get an ABORT when I focus the Neovide app. I guess Neovide is not setting up things properly in their app bundle, but it should not cause an ABORT :)

Here is the trace from the ABORT:

2023-11-13 11:01:43.206 sketchybar[37865:3557963] *** Assertion failure in -[NSWorkspace URLForApplicationWithBundleIdentifier:], NSWorkspace.m:613
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: bundleIdentifier != nil'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000180c96800 __exceptionPreprocess + 176
    1   libobjc.A.dylib                     0x000000018078deb4 objc_exception_throw + 60
    2   Foundation                          0x0000000181ddd47c -[NSCalendarDate initWithCoder:] + 0
    3   AppKit                              0x00000001845c3858 -[NSWorkspace URLForApplicationWithBundleIdentifier:] + 140
    4   sketchybar                          0x0000000101003860 workspace_icon_for_app + 304
    5   sketchybar                          0x0000000100fee2b0 image_load + 828
    6   sketchybar                          0x0000000100fea610 bar_item_parse_set_message + 3008
    7   sketchybar                          0x0000000100ff42a8 handle_message_mach + 816
    8   sketchybar                          0x0000000100fec8f8 event_post + 84
    9   sketchybar                          0x0000000100ff88c0 mach_message_handler + 32
    10  sketchybar                          0x0000000101000a54 mach_message_callback + 40
    11  CoreFoundation                      0x0000000180c51724 __CFMachPortPerform + 296
    12  CoreFoundation                      0x0000000180c2228c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60
    13  CoreFoundation                      0x0000000180c221ac __CFRunLoopDoSource1 + 520
    14  CoreFoundation                      0x0000000180c20b78 __CFRunLoopRun + 2244
    15  CoreFoundation                      0x0000000180c1fc5c CFRunLoopRunSpecific + 608
    16  HIToolbox                           0x000000018b19c448 RunCurrentEventLoopInMode + 292
    17  HIToolbox                           0x000000018b19c284 ReceiveNextEventCommon + 648
    18  HIToolbox                           0x000000018b2e53f8 RunApplicationEventLoop + 168
    19  sketchybar                          0x0000000100fe38a0 main + 836
    20  dyld                                0x00000001807c90e0 start + 2360
)
libc++abi: terminating due to uncaught exception of type NSException
[1]    37865 abort      sketchybar
FelixKratz commented 8 months ago

Thanks for the report! I think it should be fixed on master. I have released a hotfix for this in v2.19.3.

I think the neovide app behaves improper when launched from the commandline...

crisidev commented 8 months ago

Works perfectly, thanks for the quick fix!