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

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

Closed
YihaoPeng opened this issue Jul 4, 2019 · 8 comments
Labels
Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Resolution-Answered Related to questions that have been answered

Comments

@YihaoPeng
Copy link

YihaoPeng commented 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.

@YihaoPeng YihaoPeng added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jul 4, 2019
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 4, 2019
@DHowett-MSFT
Copy link
Contributor

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

@zadjii-msft zadjii-msft added Issue-Question For questions or discussion Resolution-Answered Related to questions that have been answered and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Jul 8, 2019
@luke1961
Copy link

luke1961 commented May 9, 2020

Works for me including win 2019 server

@DHowett-MSFT
Copy link
Contributor

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

@NotWearingPants
Copy link
Contributor

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

@brian6932
Copy link

brian6932 commented 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.

@zadjii-msft
Copy link
Member

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

@brian6932
Copy link

brian6932 commented 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 😓

@zadjii-msft
Copy link
Member

Glad it went away? 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Resolution-Answered Related to questions that have been answered
Projects
None yet
Development

No branches or pull requests

6 participants