Skip to content

open's --args are ignored if macos-launch-services-cmdline is present #7135

@toxxmeister

Description

@toxxmeister

Describe the bug
If macos-launch-services-cmdline file is present, open's --args is entirely ignored and macos-launch-services-cmdline is anyways applied.
Given macos-launch-services-cmdline's purpose, which is to provide command line arguments to kitty when launching from the GUI, I expected to be able to override this when launching through open -na /Applications/kitty.app --args <...>.

This might be entirely intended, for whichever reasons, but still I felt it's worthwhile to start a discussion, as to me personally it's unexpected.

To Reproduce
Steps to reproduce the behavior:

  1. Create a <kitty-config>/macos-launch-services-cmdline file with the content -1.
  2. Open kitty from the terminal using open -na /Applications/kitty.app --args -1 --instance-group x
  3. Observe that a new OS window is launched in the existing single instance, instead of a new single instance (group x) being launched. (Single dock icon, instead of two)

Additional context
I wanted to have two different single kitty instances running, a general purpose one usually launched through the GUI which has remote control disabled, and a quake/tilde/visor one with remote control enabled.
To achieve this, I added -1 --instance group main to macos-launch-services-cmdline and launched the quake instance through open -na /Applications/kitty.app --args -1 --instance-group qitty --listen-on unix:/tmp/qitty.

While I'm sure there are better ways to achieve this, I had issues particular to my workflow that led me down this path.
Currently I settled on backing-up and later restoring macos-launch-services-cmdline while launching the quake instance, which is rather ugly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions