mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 10:12:17 +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':
|
if ans and ans[0] == 'kitty':
|
||||||
del ans[0]
|
del ans[0]
|
||||||
if '-1' in ans or '--single-instance' in ans:
|
if '-1' in ans or '--single-instance' in ans:
|
||||||
# Re-exec with new argv so that the C code that handles single instance
|
if '-1' in argv_args or '--single-instance' in argv_args:
|
||||||
# can pick up the modified argv
|
# C code will already have setup single instance
|
||||||
os.environ['KITTY_LAUNCHED_BY_LAUNCH_SERVICES'] = '2' # so that use_os_log is set in the re-execed process
|
log_error(
|
||||||
os.execl(kitty_exe(), 'kitty', *(ans + argv_args))
|
'--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
|
return ans + argv_args
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user