File tree 2 files changed +34
-2
lines changed
src/cascadia/TerminalConnection 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -428,6 +428,28 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
428
428
TerminalOutput.raise (L" \r\n " );
429
429
TerminalOutput.raise (badPathText);
430
430
}
431
+ // If the requested action requires elevation, display appropriate message
432
+ else if (hr == HRESULT_FROM_WIN32 (ERROR_ELEVATION_REQUIRED))
433
+ {
434
+ const auto elevationText = RS_ (L" ElevationRequired" );
435
+ TerminalOutput.raise (L" \r\n " );
436
+ TerminalOutput.raise (elevationText);
437
+ }
438
+ // If a stop signal (ctrl+c) is detected, display appropriate message
439
+ else if (hr == HRESULT_FROM_NT (STATUS_CONTROL_C_EXIT))
440
+ {
441
+ const auto ctrlCText = RS_ (L" CtrlCToClose" );
442
+ TerminalOutput.raise (L" \r\n " );
443
+ TerminalOutput.raise (ctrlCText);
444
+ }
445
+ // If the command or file is invalid, display appropriate message
446
+ else if (hr == HRESULT_FROM_WIN32 (ERROR_BAD_COMMAND) || hr == HRESULT_FROM_WIN32 (ERROR_FILE_NOT_FOUND))
447
+ {
448
+ const auto badCommandText = RS_fmt (L" BadCommandOrFile" , _commandline);
449
+ TerminalOutput.raise (L" \r\n " );
450
+ TerminalOutput.raise (badCommandText);
451
+ }
452
+
431
453
432
454
_transitionToState (ConnectionState::Failed);
433
455
Original file line number Diff line number Diff line change 209
209
</data >
210
210
<data name =" CtrlDToClose" xml : space =" preserve" >
211
211
<value >You can now close this terminal with Ctrl+D, or press Enter to restart.</value >
212
- <comment >"Ctrl+D" and "Enter" represent keys the user will press (control+D and Enter).</comment >
212
+ <comment >"Ctrl+D" and "Enter" represent keys the user will press (control+D and Enter).</comment >
213
213
</data >
214
214
<data name =" ProcessFailedToLaunch" xml : space =" preserve" >
215
215
<value >[error {0} when launching `{1}']</value >
220
220
<value >Could not access starting directory "{0}"</value >
221
221
<comment >The first argument {0} is a path to a directory on the filesystem, as provided by the user.</comment >
222
222
</data >
223
- </root >
223
+ <data name =" ElevationRequired" xml : space =" preserve" >
224
+ <value >The requested operation requires elevation.</value >
225
+ </data >
226
+ <data name =" CtrlCToClose" xml : space =" preserve" >
227
+ <value >{Application Exit by CTRL+C} The application terminated as a result of a CTRL+C.</value >
228
+ </data >
229
+ <data name =" BadCommandOrFile" xml : space =" preserve" >
230
+ <value >{0} is not recognized as an internal or external command, operable program or batch file.</value >
231
+ <comment >The first argument {0} is the command or file, as provided by the user</comment >
232
+ </data >
233
+ </root >
You can’t perform that action at this time.
0 commit comments