Skip to content

Cross platform open file #122

Open
Open
@CarlAndersson

Description

@CarlAndersson

I'm migrating to using pixi tasks to run various python-related scripts. Most of these generate some output that the user typically wants to open in the default application on their desktop. It would be convenient to have a built-in cross-platform command in the task shell to open files in the desktop.

On macos, this is done with open path/to/file.txt, and spaces can be handled with quoting open "path/to/file with space.txt"
On windows (powershell), .\path\to\file.txt seems to work, and spaces should be quoted like .\"path\to\file with space.txt"
I don't have access to any non-apple unix platform at the moment, but a quick google indicates xdg-open as the equivalent to macos open.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions