-
Notifications
You must be signed in to change notification settings - Fork 248
Description
Discussed in #7252
Originally posted by awildbobcat August 11, 2025
Hi,
I'm unable to save any edit to the keybindings when running the .app bundle directly.
This works fine when running the executable directly /Applications/Binary Ninja.app/Contents/MacOS/binaryninja
.
In both cases, the user configuration file in ~/Library/Application Support/Binary Ninja/keybindings.json
seems to be ignored.
When running the executable directly and editing the bindings, a keybinding.json
file is created in the current working directory from where the executable was launched.
I suspect that the keybindings.json
file is read from and written to using the current working directory. When running the app bundle, the current working directory is set by the OS to a read-only directory, preventing me from saving my bindings.
Running sudo fs_usage -w | grep -i keybindings.json -C1
and opening a new Binary Ninja process suggests a relative path is used:
0.000001 binaryninja.229398
21:45:55.384608 stat64 [ 2] keybindings.json
I am using the latest free version (5.1.8005) on MacOS 15.5.
Specifically this happens due to the fallback logic within BinaryNinja::GetPathRelativeToUserDirectory
:
binaryninja-api/binaryninjaapi.cpp
Lines 177 to 179 in cde1c38
char* path = BNGetPathRelativeToUserDirectory(rel.c_str()); | |
if (!path) | |
return rel; |
BNGetPathRelativeToUserDirectory
returns nullptr in the free version, so this ends up returning a path relative to the current working directory.