When I start the Windows Terminal, I get the following:
How do I get rid of the copyright & version notifications, the help URL and the update check? I just want to get to the command line.
My powershell profile in the settings.json (the config file for the Windows Terminal) is like this:
{ "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", "hidden": false, "name": "PowerShell", "source": "Windows.Terminal.PowershellCore", "fontFace": "Cascadia Code PL", "startingDirectory": "C:\\Users\\user1\\desktop\\" } I've seen flags like -nologo and so forth, but I don't have a command line to pass it to.
31 Answer
Create a custom profile in Windows Terminal's settings.json file as follows (inside the profiles.list array property):
As of at least PowerShell 7.2.1 -nologo also deactivates update notifications:Thanks, Maximilian Hils.
{ // no strict need for a GUID; create a *new* one, if needed. "hidden": false, "name": "PowerShell - no logo, no update notification", "commandline": "pwsh.exe -nologo" // ... other properties omitted. }, In earlier versions you may need environment variable POWERSHELL_UPDATECHECK to disable update notifications:
{ // no strict need for a GUID; create a *new* one, if needed. "hidden": false, "name": "PowerShell - no logo, no update notification", "commandline": "cmd /c set POWERSHELL_UPDATECHECK=Off & pwsh.exe -nologo" // ... other properties omitted. }, Copy the
startingDirectoryandfontFaceproperties from the dynamic profile shown in your question, if desired. (Dynamic profiles are auto-generated by Windows Terminal itself, depending on what shells are found to be installed; they have asourceproperty whose value starts withWindows.Terminal, as in the entry shown in your question.There is no strict need for a
guidproperty in this case (generally, names and GUIDs can be used interchangeably to identify a profile); if you do use one, create a new GUID (e.g. withNew-Guid).- If you want to use the same
namevalue as that of the dynamic PowerShell Core profile, it's best to hide the latter by setting itshiddenproperty totrue.
- If you want to use the same
Custom profiles use a
commandlineproperty to define what command to execute when a tab with this profile is generated. The value above assumes that PowerShell's executable,pwsh.exe, is in your path; if it isn't and you therefore need to specify a full path, be sure to either double\chars. (e.g.\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\") or use/instead (e.g.\"C:/Program Files/PowerShell/7/pwsh.exe\")May be required in PowerShell versions before 7.2.1:
cmd /c set POWERSHELL_UPDATECHECK=Offdefines the relevant environment variable to turn off PowerShell's update notifications, and then launches PowerShell.- This means that your PowerShell instances will have a
cmd.exeparent process, but that shouldn't be a problem.
- This means that your PowerShell instances will have a
You can alternatively define this environment variable persistently, via the registry, in which case
cmd.exeis no longer needed.
Passing
-nologoto PowerShell's CLI suppresses the "logo", i.e. the copyright message and help hint.- As of at least PowerShell 7.2.1,
-nologoautomatically deactivates the update notifications as well - potentially, it has always worked this way.
- As of at least PowerShell 7.2.1,
