Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross platform open file #122

Open
CarlAndersson opened this issue Sep 4, 2024 · 0 comments
Open

Cross platform open file #122

CarlAndersson opened this issue Sep 4, 2024 · 0 comments

Comments

@CarlAndersson
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant