[Interesting Usage] Replace the Windows default conhost.exe to OpenConsole.exe #2547

Closed
opened 2026-01-30 22:58:04 +00:00 by claunia · 8 comments
Owner

Originally created by @YihaoPeng on GitHub (Jul 4, 2019).

Since Windows Terminal is currently performing poorly in copying and pasting, I think OpenConsole is my better choice.

However, if you do not run it from OpenConsole, Windows will append the default console host (C:\Windows\System32\conhost.exe) to all console applications.

Then Microsoft said that the source code of OpenConsole comes from conhost.exe, then can we replace conhost.exe directly with OpenConsole.exe? This way we get a better default console host.

I tried it and it works well. Although OpenConsole is packaged as a UWP application, OpenConsole.exe is actually a normal Win32 window program that can be run by double-clicking its exe. You can find it from terminal\bin\x64\Release\OpenConsole.exe if you done a x64 release build.

Then, go to C:\Windows\System32, right-click conhost.exe, "Properties", and edit the permission list to give the current user the "Full Control" permission.

Then, rename conhost.exe to conhost-old.exe and copy OpenConsole.exe to here and rename it to conhost.exe.

Open any console application (powershell, wsl, ...) and enjoy your new console.

Originally created by @YihaoPeng on GitHub (Jul 4, 2019). Since Windows Terminal is currently performing poorly in copying and pasting, I think OpenConsole is my better choice. However, if you do not run it from OpenConsole, Windows will append the default console host (`C:\Windows\System32\conhost.exe`) to all console applications. Then Microsoft said that the source code of OpenConsole comes from conhost.exe, then can we replace conhost.exe directly with OpenConsole.exe? This way we get a better default console host. I tried it and it works well. Although OpenConsole is packaged as a UWP application, OpenConsole.exe is actually a normal Win32 window program that can be run by double-clicking its exe. You can find it from `terminal\bin\x64\Release\OpenConsole.exe` if you done a x64 release build. Then, go to `C:\Windows\System32`, right-click `conhost.exe`, "Properties", and edit the permission list to give the current user the "Full Control" permission. Then, rename `conhost.exe` to `conhost-old.exe` and copy `OpenConsole.exe` to here and rename it to `conhost.exe`. Open any console application (powershell, wsl, ...) and enjoy your new console.
claunia added the Issue-QuestionNeeds-TriageNeeds-Tag-FixResolution-Answered labels 2026-01-30 22:58:04 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 4, 2019):

You found our secret! We offer no warranty for using openconsole like this!

@DHowett-MSFT commented on GitHub (Jul 4, 2019): You found our secret! **We offer no warranty for using openconsole like this!**
Author
Owner

@luke1961 commented on GitHub (May 10, 2020):

Works for me including win 2019 server

@luke1961 commented on GitHub (May 10, 2020): Works for me including win 2019 server
Author
Owner

@DHowett-MSFT commented on GitHub (May 10, 2020):

It might work all the way down to Windows 8.1. Again, no warranty!

@DHowett-MSFT commented on GitHub (May 10, 2020): It _might_ work all the way down to Windows 8.1. Again, no warranty!
Author
Owner

@SnirBroshi commented on GitHub (Nov 5, 2020):

The open issue of this is #492
(for people coming here from search)

@SnirBroshi commented on GitHub (Nov 5, 2020): The open issue of this is #492 (for people coming here from search)
Author
Owner

@brian6932 commented on GitHub (May 30, 2023):

Sometimes opening OpenConsole just results in nothing opening, not sure what the cause was.
I got the following error when attempting to launch cmd or pwsh with OpenConsole as conhost when the issue happened:

I can no longer reproduce it.

@brian6932 commented on GitHub (May 30, 2023): Sometimes opening OpenConsole just results in nothing opening, not sure what the cause was. I got the following error when attempting to launch cmd or pwsh with `OpenConsole` as `conhost` when the issue happened: ![](https://github.com/microsoft/terminal/assets/18603393/8a29b9a3-dde8-4bc7-b6eb-8fb85352345f) I can no longer reproduce it.
Author
Owner

@zadjii-msft commented on GitHub (May 30, 2023):

@brian6932 That can't possibly be the right commit, or at the very least, that's happenstance. The only two code changes in https://github.com/microsoft/terminal/compare/v1.17.11391.0...v1.17.11461.0 are firmly in Terminal-only code. None of that's compiled into OpenConsole.exe at all...

@zadjii-msft commented on GitHub (May 30, 2023): @brian6932 That can't _possibly_ be the right commit, or at the very least, that's happenstance. The only two code changes in https://github.com/microsoft/terminal/compare/v1.17.11391.0...v1.17.11461.0 are firmly in Terminal-only code. None of that's compiled into OpenConsole.exe at all...
Author
Owner

@brian6932 commented on GitHub (May 30, 2023):

Ok, it seems like it wasn't even a tag issue, I'm not sure what causes that, but somehow the older OpenConsole releases didn't exhibit it, now the newest pre-release and release are working fine again 😓

@brian6932 commented on GitHub (May 30, 2023): Ok, it seems like it wasn't even a tag issue, I'm not sure what causes that, but somehow the older OpenConsole releases didn't exhibit it, now the newest pre-release and release are working fine again 😓
Author
Owner

@zadjii-msft commented on GitHub (May 30, 2023):

Glad it went away? 😅

@zadjii-msft commented on GitHub (May 30, 2023): Glad it went away? 😅
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2547