mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-09 15:08:13 +02:00
log a warning that double --single-instance will ignore the one from macos-launch-services-cmdline
This commit is contained in:
@@ -321,10 +321,16 @@ def macos_cmdline(argv_args: list[str]) -> list[str]:
|
||||
if ans and ans[0] == 'kitty':
|
||||
del ans[0]
|
||||
if '-1' in ans or '--single-instance' in ans:
|
||||
# Re-exec with new argv so that the C code that handles single instance
|
||||
# can pick up the modified argv
|
||||
os.environ['KITTY_LAUNCHED_BY_LAUNCH_SERVICES'] = '2' # so that use_os_log is set in the re-execed process
|
||||
os.execl(kitty_exe(), 'kitty', *(ans + argv_args))
|
||||
if '-1' in argv_args or '--single-instance' in argv_args:
|
||||
# C code will already have setup single instance
|
||||
log_error(
|
||||
'--single-instance supplied in both command line arguments and macos-launch-services-cmdline,'
|
||||
' ignoring any --instance-group in macos-launch-services-cmdline')
|
||||
else:
|
||||
# Re-exec with new argv so that the C code that handles single instance
|
||||
# can pick up the modified argv
|
||||
os.environ['KITTY_LAUNCHED_BY_LAUNCH_SERVICES'] = '2' # so that use_os_log is set in the re-execed process
|
||||
os.execl(kitty_exe(), 'kitty', *(ans + argv_args))
|
||||
return ans + argv_args
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user