fix: suppress console on windows release builds #1006

Open
chakany wants to merge 1 commit from chakany/fix-windows-console into master
chakany commented 2025-10-04 07:32:13 +13:00 (Migrated from github.com)

I installed gossip on my Windows 11 machine using the msi installer and noticed that when I opened it it would also open a terminal window to log events. I checked the codebase, and compared it against my own egui app's codebase, and found that the macro that controls this behavior was set differently. When I changed it and re-compiled in release mode, the terminal window no longer appeared.

It is a simple one-line change.

- #![cfg_attr(not(debug_assertions), windows_subsystem = "console")]
+ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
I installed gossip on my Windows 11 machine using the msi installer and noticed that when I opened it it would also open a terminal window to log events. I checked the codebase, and compared it against my own egui app's codebase, and found that the macro that controls this behavior was set differently. When I changed it and re-compiled in release mode, the terminal window no longer appeared. It is a simple one-line change. ```diff - #![cfg_attr(not(debug_assertions), windows_subsystem = "console")] + #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] ```
mikedilger commented 2025-10-04 08:24:41 +13:00 (Migrated from github.com)

I find the console to be important. I know it seems like a debugging leftover, or annoying, and it prints way too much stuff, but the main UI window doesn't have enough space to show most of the error conditions that you might want to be aware of. A better path forward would be to have an error indicator in the UI that you can click to open which shows long lines of errors, and of course to prune back the output, and only then remove the console.

You can run without the console if it works well enough for you and you don't think you can do anything about the conditions that get printed. But by default, for now, I think I'll leave it.

I find the console to be important. I know it seems like a debugging leftover, or annoying, and it prints way too much stuff, but the main UI window doesn't have enough space to show most of the error conditions that you might want to be aware of. A better path forward would be to have an error indicator in the UI that you can click to open which shows long lines of errors, and of course to prune back the output, and only then remove the console. You can run without the console if it works well enough for you and you don't think you can do anything about the conditions that get printed. But by default, for now, I think I'll leave it.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin chakany/fix-windows-console:chakany/fix-windows-console
git switch chakany/fix-windows-console

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff chakany/fix-windows-console
git switch chakany/fix-windows-console
git rebase master
git switch master
git merge --ff-only chakany/fix-windows-console
git switch chakany/fix-windows-console
git rebase master
git switch master
git merge --no-ff chakany/fix-windows-console
git switch master
git merge --squash chakany/fix-windows-console
git switch master
git merge --ff-only chakany/fix-windows-console
git switch master
git merge chakany/fix-windows-console
git push origin master
Sign in to join this conversation.
No description provided.