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

Hide console window by default on Windows #53884

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Oct 16, 2021

This prevents issues with text selection causing the editor to freeze indefinitely until said selection is aborted. This also matches Blender's behavior where the system console is hidden bydefault.

This also renames the setting to work in an affirmative manner ("show" instead of "hide").

Testing is welcome, as I haven't tested this on a proper Windows setup yet.

This closes #34200.

@Calinou Calinou requested a review from a team as a code owner October 16, 2021 15:54
@Calinou Calinou added this to the 4.0 milestone Oct 16, 2021
@Calinou Calinou force-pushed the windows-default-hide-console-window branch from 26c76e1 to cc61b82 Compare October 16, 2021 15:55
main/main.cpp Outdated Show resolved Hide resolved
This prevents issues with text selection causing the editor to freeze
indefinitely until said selection is aborted.

This also renames the setting to work in an affirmative manner
("show" instead of "hide").
@Calinou Calinou force-pushed the windows-default-hide-console-window branch from cc61b82 to 4a60a1e Compare October 16, 2021 16:41
@mhilbrunner mhilbrunner self-requested a review October 28, 2021 13:22
@starry-abyss
Copy link
Contributor

I agree with hiding the console by default, but isn't the linked issue about when it's open, regardless of the default state?

@Calinou
Copy link
Member Author

Calinou commented Oct 28, 2021

I agree with hiding the console by default, but isn't the linked issue about when it's open, regardless of the default state?

It is, but it becomes much less of a concern if you have to toggle the console manually. The original issue is a Windows limitation; we can't fix it without disabling text selection, which would prevent copy-pasting.

@starry-abyss
Copy link
Contributor

This is kind of nitpicking, but why not just manually close the issue honestly saying "we won't fix this"? Why use this trick to pretend it's solved?

@Calinou
Copy link
Member Author

Calinou commented Oct 28, 2021

This is kind of nitpicking, but why not just manually close the issue honestly saying "we won't fix this"? Why use this trick to pretend it's solved?

The original issue is still affecting users by default, which means it's far more likely to be encountered right now. By hiding the console by default, people won't encounter this issue nearly as often.

@mhilbrunner
Copy link
Member

mhilbrunner commented Oct 28, 2021

I somewhat agree with the comment that this doesn't fix that issue (although it reduces the impact).
So IMO we shouldn't close that issue because of this PR (whether we should close it as 'won't fix' is a seperate discussion that should happen in that issue IMO).

But having the console window hidden by default is a good idea for a number of reasons, IMO, so I like this PR. I'll try to test and review soon.

@akien-mga
Copy link
Member

akien-mga commented Oct 28, 2021

The issue can't be fixed, it's a Windows design choice. It's working as intended/not a bug. But our users experience it as a bug as it's crappy design, so a workaround is a proper fix (from Godot perspective) and the only one we can do.

Edit: I spoke too fast, see below.

@akien-mga
Copy link
Member

Or well, maybe it can be fixed fully. The freeze happens due to the Windows 10+ "Quick Edit" feature of the console, which can apparently be disabled programmatically:
https://stackoverflow.com/questions/15750276/my-ui-hangs-when-i-select-some-area-in-the-console/15751433#15751433

@Calinou
Copy link
Member Author

Calinou commented Oct 28, 2021

Or well, maybe it can be fixed fully. The freeze happens due to the Windows 10+ "Quick Edit" feature of the console, which can apparently be disabled programmatically: stackoverflow.com/questions/15750276/my-ui-hangs-when-i-select-some-area-in-the-console/15751433#15751433

Disabling quick edit apparently disallows text selection, which in turn disallows copy-pasting text from the console. This makes searching for errors online more difficult.

@akien-mga
Copy link
Member

Well, bad_design++, but yeah that simply restores the pre-Windows 10 cmd.exe behavior where copying anything was almost impossible - you can still do it with right click, select all, and Ctrl-C twice IIRC.

But we could also expose this as an option, defaulting to disabling Quick Edit but with an easy way to re-enable it (it's just a SetConsoleMode call, like for showing/hiding the console).

@akien-mga
Copy link
Member

Superseded by #56012.

@akien-mga akien-mga closed this Jan 17, 2022
@Calinou Calinou deleted the windows-default-hide-console-window branch January 17, 2022 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editor freezes when selecting text in the system console due to Windows limitation
4 participants