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

fix: Attach to the console on Windows #2070

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

certik
Copy link
Contributor

@certik certik commented Sep 17, 2024

This makes std::cout working again after switching to a GUI application in #2067. It still does not open a console when launched from the Windows Explorer, but when launched from a terminal, it will now print to the terminal again, as before.

This makes `std::cout` working again after switching to a GUI
application in prefix-dev#2067. It still
does not open a console when launched from the Windows Explorer, but
when launched from a terminal, it will now print to the terminal again,
as before.
@certik certik changed the title Attach to the console on Windows fix: Attach to the console on Windows Sep 17, 2024
@certik
Copy link
Contributor Author

certik commented Sep 17, 2024

I tested on Windows natively (in a shell) and on Linux (in WSL) and it works for me in both.

@baszalmstra
Copy link
Contributor

This seems rather complex for an example. Is this worth having the ability to start the built executable from outside pixi?

Instead of std::cout we could also use https://wiki.libsdl.org/SDL2/SDL_ShowSimpleMessageBox perhaps?

@certik
Copy link
Contributor Author

certik commented Sep 18, 2024

The std::cout is used for error messages if SDL cannot be initialized, so probably we can't use SDL itself to show the error.

Yes, it's quite complex, so maybe not worth doing. This seems to be the right approach to get it fully working on Windows, so I posted it here.

Regarding the ability to start outside of pixi, I would say that depends on what the goal of pixi is: is it supposed to create standalone executables that run on their own, or is the goal to always require pixi to setup the proper environment?

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

Successfully merging this pull request may close these issues.

2 participants