Show a more descriptive error message when the ConptyConnection fails to start for some reason #10007

Closed
opened 2026-01-31 02:09:56 +00:00 by claunia · 11 comments
Owner

Originally created by @RufusJWB on GitHub (Aug 5, 2020).

Description of the new feature/enhancement

Show a speaking error message, when it is necessary to run Terminal with admin privileges. See https://github.com/microsoft/terminal/issues/4272 for the problem

Proposed technical implementation details (optional)

Originally created by @RufusJWB on GitHub (Aug 5, 2020). # Description of the new feature/enhancement Show a speaking error message, when it is necessary to run Terminal with admin privileges. See https://github.com/microsoft/terminal/issues/4272 for the problem # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. -->
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Aug 5, 2020):

How about just displaying the error message that matches the error code, like so:

[error 0x800702e4 when launching `C:\Program Files\PowerShell\6\pwsh.exe']
The requested operation requires elevation.

Or does Windows Terminal have to recognize the 0x800702e4 code specifically and display something more verbose?

@KalleOlaviNiemitalo commented on GitHub (Aug 5, 2020): How about just displaying the error message that matches the error code, like so: ``` [error 0x800702e4 when launching `C:\Program Files\PowerShell\6\pwsh.exe'] The requested operation requires elevation. ``` Or does Windows Terminal have to recognize the 0x800702e4 code specifically and display something more verbose?
Author
Owner

@RufusJWB commented on GitHub (Aug 5, 2020):

I think displaying the error message would be perfectly fine. I had to google it. With the error message, this wouldn't have been necessary.

@RufusJWB commented on GitHub (Aug 5, 2020): I think displaying the error message would be perfectly fine. I had to google it. With the error message, this wouldn't have been necessary.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Aug 5, 2020):

Could even extend that to process exit codes that look like NTSTATUS error codes:

[process exited with code 3221225786]
The application terminated as a result of a CTRL+C.

That would have a greater risk of false matches, though.

@KalleOlaviNiemitalo commented on GitHub (Aug 5, 2020): Could even extend that to process exit codes that look like NTSTATUS error codes: ``` [process exited with code 3221225786] The application terminated as a result of a CTRL+C. ``` That would have a greater risk of false matches, though.
Author
Owner

@zadjii-msft commented on GitHub (Aug 5, 2020):

This isn't a bad idea, and I bet @DHowett thought about something like this when he first added the error codes

@zadjii-msft commented on GitHub (Aug 5, 2020): This isn't a bad idea, and I bet @DHowett thought about something like this when he first added the error codes
Author
Owner

@DHowett commented on GitHub (Aug 6, 2020):

Yeah, we can definitely do better with these error messages!

@DHowett commented on GitHub (Aug 6, 2020): Yeah, we can definitely do better with these error messages!
Author
Owner

@zadjii-msft commented on GitHub (Apr 7, 2022):

For those who'd like to try this themselves, I added a similar kind of error message in #10045.

Collected relevant error messages:

Symbolic Name Error Description Header
ERROR_ELEVATION_REQUIRED The requested operation requires elevation. winerror.h
STATUS_CONTROL_C_EXIT {Application Exit by CTRL+C} The application terminated as a result of a CTRL+C. ntstatus.h
MSG_DIR_BAD_COMMAND_OR_FILE '%1' is not recognized as an internal or external command, operable program or batch file. cmdmsg.h
@zadjii-msft commented on GitHub (Apr 7, 2022): For those who'd like to try this themselves, I added a similar kind of error message in #10045. Collected relevant error messages: Symbolic Name | Error Description | Header -- | -- | -- ERROR_ELEVATION_REQUIRED | The requested operation requires elevation. | winerror.h STATUS_CONTROL_C_EXIT | {Application Exit by CTRL+C} The application terminated as a result of a CTRL+C. | ntstatus.h [MSG_DIR_BAD_COMMAND_OR_FILE ](https://github.com/microsoft/terminal/issues/11073)| '%1' is not recognized as an internal or external command, operable program or batch file. | cmdmsg.h
Author
Owner

@Harshit-Agarwal-2022 commented on GitHub (Oct 7, 2024):

Hello , I have read through the issue and I want to try to help in adding the new error message , Can someone guide me as to how to recreate the same runtime conditions as in #4272 ?

@Harshit-Agarwal-2022 commented on GitHub (Oct 7, 2024): Hello , I have read through the issue and I want to try to help in adding the new error message , Can someone guide me as to how to recreate the same runtime conditions as in #4272 ?
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Oct 8, 2024):

@Harshit-Agarwal-2022, create a Windows Terminal profile that runs %windir%\system32\msconfig.exe, and try to start that profile. The application requires elevation, and this causes error 2147943140 (0x800702e4) as in https://github.com/microsoft/terminal/issues/4272 (unless Windows Terminal itself is elevated).

@KalleOlaviNiemitalo commented on GitHub (Oct 8, 2024): @Harshit-Agarwal-2022, create a Windows Terminal profile that runs `%windir%\system32\msconfig.exe`, and try to start that profile. The application requires elevation, and this causes error 2147943140 (0x800702e4) as in <https://github.com/microsoft/terminal/issues/4272> (unless Windows Terminal itself is elevated).
Author
Owner

@ATOMworkplace commented on GitHub (Oct 15, 2024):

@Harshit-Agarwal-2022 You still working on this issue?

@ATOMworkplace commented on GitHub (Oct 15, 2024): @Harshit-Agarwal-2022 You still working on this issue?
Author
Owner

@Harshit-Agarwal-2022 commented on GitHub (Oct 16, 2024):

@ATOMworkplace I was facing some issues with vs 2022 while building the terminal repo on my local system so i havent started with the issue yet , you can work on it if you want , I was able to recreate the error log using @KalleOlaviNiemitalo 's instructions

@Harshit-Agarwal-2022 commented on GitHub (Oct 16, 2024): @ATOMworkplace I was facing some issues with vs 2022 while building the terminal repo on my local system so i havent started with the issue yet , you can work on it if you want , I was able to recreate the error log using @KalleOlaviNiemitalo 's instructions
Author
Owner

@ATOMworkplace commented on GitHub (Oct 16, 2024):

@Harshit-Agarwal-2022 Sure, thanks for letting me know, I'll give it a try and see what I can do.

@ATOMworkplace commented on GitHub (Oct 16, 2024): @Harshit-Agarwal-2022 Sure, thanks for letting me know, I'll give it a try and see what I can do.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10007