OpenConsole doesn't work from SYSTEM account #23870

Closed
opened 2026-01-31 08:54:43 +00:00 by claunia · 1 comment
Owner

Originally created by @SEt-t on GitHub (Dec 9, 2025).

Windows Terminal version

git

Windows build number

10.0.19045.6456

Other Software

No response

Steps to reproduce

PsExec.exe -s cmd.exe
OpenConsole.exe

Expected Behavior

No response

Actual Behavior

First of all, it crashes in
224ac9de47/src/interactivity/win32/window.cpp (L221)
due to g.pRender being null because it wasn't created due to
224ac9de47/src/host/srvinit.cpp (L833)
got true from gci.IsInVtIoMode().

After removing that condition OpenConsole.exe starts but behaves erratically. Here is my typing exit, Enter:

C:\terminal\bin\x64\Debug>OpenConsole.exe

C:\terminal\bin\x64\Debug>←[c←[?1004h←[?9001h←[?7l←[?7hMicrosoft Windows [Version 10.0.19045.6456]
(c) Microsoft Corporation. All rights reserved.
←]0;Administrator: OpenConsole.exe←\
C:\terminal\bin\x64\Debug>exit
eit
←[4;32Hx←[4;33H'eit' is not recognized as an internal or external command,
operable program or batch file.

C:\terminal\bin\x64\Debug>
Originally created by @SEt-t on GitHub (Dec 9, 2025). ### Windows Terminal version git ### Windows build number 10.0.19045.6456 ### Other Software _No response_ ### Steps to reproduce PsExec.exe -s cmd.exe OpenConsole.exe ### Expected Behavior _No response_ ### Actual Behavior First of all, it crashes in https://github.com/microsoft/terminal/blob/224ac9de4758f67b7f83b74909d1c60f15715a3c/src/interactivity/win32/window.cpp#L221 due to `g.pRender` being null because it wasn't created due to https://github.com/microsoft/terminal/blob/224ac9de4758f67b7f83b74909d1c60f15715a3c/src/host/srvinit.cpp#L833 got `true` from `gci.IsInVtIoMode()`. After removing that condition OpenConsole.exe starts but behaves erratically. Here is my typing `exit`, Enter: ``` C:\terminal\bin\x64\Debug>OpenConsole.exe C:\terminal\bin\x64\Debug>←[c←[?1004h←[?9001h←[?7l←[?7hMicrosoft Windows [Version 10.0.19045.6456] (c) Microsoft Corporation. All rights reserved. ←]0;Administrator: OpenConsole.exe←\ C:\terminal\bin\x64\Debug>exit eit ←[4;32Hx←[4;33H'eit' is not recognized as an internal or external command, operable program or batch file. C:\terminal\bin\x64\Debug> ```
claunia added the Needs-TriageIssue-Bug labels 2026-01-31 08:54:43 +00:00
Author
Owner

@DHowett commented on GitHub (Dec 9, 2025):

Thanks for the report. For OpenConsole (conhost) to work properly, it needs to be able to spawn a window. It cannot spawn a window if it does not have access to the desktop session.

If you pass -i to psexec, the spawned application will be allowed access to the desktop session.

OpenConsole (conhost) is not intended to work in standard console hosting mode in console redirection scenarios where standard input and standard output are populated.

@DHowett commented on GitHub (Dec 9, 2025): Thanks for the report. For OpenConsole (conhost) to work properly, it needs to be able to spawn a window. It cannot spawn a window if it does not have access to the desktop session. If you pass `-i` to psexec, the spawned application will be allowed access to the desktop session. OpenConsole (conhost) is not intended to work in standard console hosting mode in console redirection scenarios where standard input and standard output are populated.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23870