[CMD] Improve the situations when the console title can be changed.

- Introduce two small helpers to change and restore the console title.
- Console title can change even when internal commands are executed.
- Note that when commands are run from within batch files, title is unchanged.
- When "cmd.exe /c command" is run, the console title is unchanged; however
  when "cmd.exe /k command" is run, the console title changes.
This commit is contained in:
Hermès Bélusca-Maïto 2018-06-03 02:15:44 +02:00
parent 39af25024a
commit a165999067
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 70 additions and 27 deletions

View file

@ -28,7 +28,8 @@ INT cmd_title(LPTSTR param)
return 0;
}
bTitleSet = TRUE;
/* Set the new console title, and tell CMD to not reset it */
bTitleSet = FALSE;
return ConSetTitle(param);
}