If the user changes the OS terminal to one that cannot be hidden by its clients, then blender cannot hide it #96672

Open
opened 2022-03-21 13:31:51 +01:00 by Dan McLaughlin · 19 comments

System Information
Operating system: Win11 (also probably true on Win10)
Graphics card: 3090

Blender Version
Broken: 3.1
Worked: probably N/A

Short description of error
When Windows Terminal is set as the default terminal Blender will launch under it, but can't hide it - the terminal will always be visible and Window>Toggle System Console doesn't work.

Updated from Harleys comment - since Blender can't work with Windows Terminal and it breaks the use model and menu choice, change this to a request to have Blender only use the old style Windows terminal regardless of the default terminal.

Exact steps for others to reproduce the error
Windows Terminal is a Microsoft replacement for the default cmd window, supporting tabs, settings and other advanced features.

  • Install Windows Terminal (Microsoft Store or otherwise)
  • Open it, on the tab bar click the down arrow
  • Click Settings in the menu (or just hit Ctrl-,)
  • Set Default terminal application to Windows Terminal
  • Close, start blender which launches from a Windows Terminal
  • Close the terminal and Blender quits
  • Toggle System Console doesn't work either

**System Information** Operating system: Win11 (also probably true on Win10) Graphics card: 3090 **Blender Version** Broken: 3.1 Worked: probably N/A **Short description of error** When Windows Terminal is set as the default terminal Blender will launch under it, but can't hide it - the terminal will always be visible and Window>Toggle System Console doesn't work. Updated from Harleys comment - since Blender can't work with Windows Terminal and it breaks the use model and menu choice, change this to a request to have Blender only use the old style Windows terminal regardless of the default terminal. **Exact steps for others to reproduce the error** Windows Terminal is a Microsoft replacement for the default cmd window, supporting tabs, settings and other advanced features. - Install Windows Terminal (Microsoft Store or otherwise) - Open it, on the tab bar click the down arrow - Click Settings in the menu (or just hit Ctrl-,) - Set Default terminal application to Windows Terminal - Close, start blender which launches from a Windows Terminal - Close the terminal and Blender quits - Toggle System Console doesn't work either ``` ```
Author

Added subscriber: @DrMc

Added subscriber: @DrMc
Member

Added subscriber: @Harley

Added subscriber: @Harley
Member

We currently have no solution to this design change by Microsoft.

We currently use the Windows API function GetConsoleWindow to get the console window handle so that we can show/hide it. Unfortunately this does not work when using virtual terminals like Windows Terminal. The Microsoft documentation on this function not only mentions that this will not longer work, but it "does not have a virtual terminal equivalent": https://docs.microsoft.com/en-us/windows/console/getconsolewindow.

You can read more details about Microsoft's design decisions regarding this, with specific details about this issue specifically in the "Direct Window Access" section: https://docs.microsoft.com/en-us/windows/console/classic-vs-vt.

In a nutshell, virtual terminals can't be hidden by the applications they host.

We currently have no solution to this design change by Microsoft. We currently use the Windows API function `GetConsoleWindow` to get the console window handle so that we can show/hide it. Unfortunately this does not work when using virtual terminals like Windows Terminal. The Microsoft documentation on this function not only mentions that this will not longer work, but it "does not have a virtual terminal equivalent": https://docs.microsoft.com/en-us/windows/console/getconsolewindow. You can read more details about Microsoft's design decisions regarding this, with specific details about this issue specifically in the "Direct Window Access" section: https://docs.microsoft.com/en-us/windows/console/classic-vs-vt. In a nutshell, virtual terminals can't be hidden by the applications they host.
Dan McLaughlin changed title from Windows Terminal as default terminal, Blender can't control it (no toggling) to Blender Windows should ignore default terminal and always use cmd 2022-03-22 00:06:13 +01:00
Author

Thanks for the informative reply Harley!

OK then, I updated the task to "Blender should only use the old style terminal, regardless of the preferences setting." Maybe there's a reason why that isn't easy, but since virtual terminals breaks Blender features Blender should just not allow use of Virtual terminals, and ignore the Windows preference.

Thanks for the informative reply Harley! OK then, I updated the task to "Blender should only use the old style terminal, regardless of the preferences setting." Maybe there's a reason why that isn't easy, but since virtual terminals breaks Blender features Blender should just not allow use of Virtual terminals, and ignore the Windows preference.

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

I'm not sure if preventing Blender from using "Windows Terminal" would be an ideal solution.
I'm not familiar with what's involved in the blender console, but blender always showing it while in other applications doesn't really seem to be a problem.
So I'm confirming as a bug for now.

I'm not sure if preventing Blender from using "Windows Terminal" would be an ideal solution. I'm not familiar with what's involved in the blender console, but blender always showing it while in other applications doesn't really seem to be a problem. So I'm confirming as a bug for now.
Germano Cavalcante changed title from Blender Windows should ignore default terminal and always use cmd to Can't hide console when 'Windows Terminal' is set as the default terminal (instead of cmd) 2022-03-22 15:33:48 +01:00
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

we don't get to pick the terminal we launch in that's up to the OS, not sure why we would classify it as a blender bug as we have no control over this?

we don't get to pick the terminal we launch in that's up to the OS, not sure why we would classify it as a blender bug as we have no control over this?
Member

This report could be reworded to "If the user changes the OS terminal to one that cannot be hidden by its clients, then blender cannot hide it"

This report could be reworded to "If the user changes the OS terminal to one that cannot be hidden by its clients, then blender cannot hide it"

As I understand the problem is the fact that Blender always launch with a terminal.
Therefore the report could be described as:
"If the user changes the OS terminal to one that cannot be hidden by its clients, then blender always launches with an unrequested terminal"

If the solution is out of control, we can consider it a Known Issue.

As I understand the problem is the fact that Blender always launch with a terminal. Therefore the report could be described as: "If the user changes the OS terminal to one that cannot be hidden by its clients, then blender always launches with an unrequested terminal" If the solution is out of control, we can consider it a `Known Issue`.
Member

Known issue would be things inside our control but no one scheduled to work on for at least 6 months

Known issue would be things *inside* our control but no one scheduled to work on for at least 6 months
Dan McLaughlin changed title from Can't hide console when 'Windows Terminal' is set as the default terminal (instead of cmd) to If the user changes the OS terminal to one that cannot be hidden by its clients, then blender cannot hide it 2022-03-22 17:07:00 +01:00
Author

Change title to Harley's suggestion - the issue really being Blender has menu picks to hide the system console when it can't.

Not a significant issue obviously but worth having an issue for at any rate for the next time somebody is in that part of the code.

Change title to Harley's suggestion - the issue really being Blender has menu picks to hide the system console when it can't. Not a significant issue obviously but worth having an issue for at any rate for the next time somebody is in that part of the code.
Member

I don't think there is much we can do "next time somebody is in that part of the code". Even if we were to test for the situation and grey out the menu option we'd still get bug reports about why. setConsoleWindowState could maybe print out an error message to the console if it gets nothing from GetConsoleWindow, assuming that is what happens in this case, but not sure anyone would notice.

In a nutshell your OS is giving you a new option. If you choose to use that by default then you lose some functionality in some programs, because of what features Microsoft has chosen to include in Windows Terminal. But they appear to be working on a fix... https://github.com/microsoft/terminal/issues/12570

I don't think there is much we can do "next time somebody is in that part of the code". Even if we were to test for the situation and grey out the menu option we'd still get bug reports about why. `setConsoleWindowState` could maybe print out an error message to the console if it gets nothing from `GetConsoleWindow`, assuming that is what happens in this case, but not sure anyone would notice. In a nutshell your OS is giving you a new option. If you *choose* to use that by default then you lose some functionality in some programs, because of what features Microsoft has chosen to include in Windows Terminal. But they appear to be working on a fix... https://github.com/microsoft/terminal/issues/12570
Contributor

Added subscriber: @Raimund58

Added subscriber: @Raimund58
Contributor

@Harley
https://github.com/microsoft/terminal/issues/12570 was closed and marked as fixed... But is it fixed for Blender as well?

@Harley https://github.com/microsoft/terminal/issues/12570 was closed and marked as fixed... But is it fixed for Blender as well?
Member

@Raimund58

That issue is our exact problem. In fact their "test case" - ::ShowWindow(::GetConsoleWindow(), SW_HIDE); - exactly describes our usage.

We've been following this issue - how Microsoft is handling this - for a while now. They came to the realization early that their changes broke a lot of usage and have been trying to come up with fixes that work but stay within their plans. That report was closed with a commit, but I've also seem some related reverts as it breaks some of their features. Regardless, the change would only be seen, for now, in something like Windows Terminal Preview , not in the general release of Windows 11 or in a Windows Update yet.

Rather than wait for Microsoft to fix this our current focus has been on the use of the blender-launcher.exe, which appears to solve this problem. However there are still some issues. For one the downloads from Windows store was not set to use that executable - I think this was recently fixed. And there are some issues to do with Taskbar Recents lists and if you select just "Blender" from the Taskbar jumplist it will launch the bare executable. @LazyDodo is working on that.

@Raimund58 That issue is our exact problem. In fact their "test case" - `::ShowWindow(::GetConsoleWindow(), SW_HIDE);` - exactly describes our usage. We've been following this issue - how Microsoft is handling this - for a while now. They came to the realization early that their changes broke a lot of usage and have been trying to come up with fixes that work but stay within their plans. That report was closed with a commit, but I've also seem some related reverts as it breaks some of their features. Regardless, the change would only be seen, for now, in something like [Windows Terminal Preview ](https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-16-release/), not in the general release of Windows 11 or in a Windows Update yet. Rather than wait for Microsoft to fix this our current focus has been on the use of the `blender-launcher.exe`, which appears to solve this problem. However there are still some issues. For one the downloads from Windows store was not set to use that executable - I think this was recently fixed. And there are some issues to do with Taskbar Recents lists and if you select just "Blender" from the Taskbar jumplist it will launch the bare executable. @LazyDodo is working on that.

Added subscriber: @Kuboa

Added subscriber: @Kuboa
Philipp Oeser removed the
Interest
Platforms, Builds & Tests
label 2023-02-10 08:58:23 +01:00

hey guys I found a solution to the problem, if you change your default terminal profile to cmd in the terminal settings, the problem will go away

hey guys I found a solution to the problem, if you change your default terminal profile to cmd in the terminal settings, the problem will go away
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#96672
No description provided.