diff --git a/src/cascadia/TerminalConnection/ConptyConnection.cpp b/src/cascadia/TerminalConnection/ConptyConnection.cpp index 9135f80247b..a6dcbd3b435 100644 --- a/src/cascadia/TerminalConnection/ConptyConnection.cpp +++ b/src/cascadia/TerminalConnection/ConptyConnection.cpp @@ -429,8 +429,9 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation // EXIT POINT const auto hr = wil::ResultFromCaughtException(); + // GH#11556 - make sure to format the error code to this string as an UNSIGNED int winrt::hstring failureText{ fmt::format(std::wstring_view{ RS_(L"ProcessFailedToLaunch") }, - fmt::format(_errorFormat, hr), + fmt::format(_errorFormat, static_cast(hr)), _commandline) }; _TerminalOutputHandlers(failureText); @@ -457,6 +458,7 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation { try { + // GH#11556 - make sure to format the error code to this string as an UNSIGNED int winrt::hstring exitText{ fmt::format(std::wstring_view{ RS_(L"ProcessExited") }, fmt::format(_errorFormat, status)) }; _TerminalOutputHandlers(L"\r\n"); _TerminalOutputHandlers(exitText);