Skip to content

[Feature] Allow to run multiple instances on macOS #945

@snechaev

Description

@snechaev

On macOS, you can typically run only a single instance of a specific application (app bundle). When you click the application icon again, it simply brings the already running app to the foreground. This can be worked around using the Terminal command: open -n <path/to/app/bundle.app>.

For Log Viewer, this means we cannot work with several logs simultaneously (without the terminal-based workaround).

The native macOS implementation for this use case would be a document-based application using NSDocument and related classes. However, Avalonia (to my knowledge) does not provide a direct equivalent for this.

So, the easiest way to address this is to bring the terminal-based workaround to the UI, making it possible to run a separate instance in just a few clicks. For example, this can be done by adding a "New Instance" item to the Dock context menu:

Image

I have created a draft implementation here. Note that it requires updating Avalonia from 11.3.11 to 11.3.13. I don't think it's a good idea to update Avalonia solely for such a minor feature, so I will postpone the PR until the dependency is updated in the normal course of development.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions