16

When I start the Windows Terminal, I get the following:

enter image description here

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.

AngryHacker
  • 59,598
  • 102
  • 325
  • 594
  • 3
    Does this answer your question? [How to I remove the Powershell start text?](https://stackoverflow.com/questions/48262269/how-to-i-remove-the-powershell-start-text) – Cpt.Whale Apr 05 '21 at 18:46
  • 1
    @user19702, the linked post only addresses _half_ of this question; additionally, this question is specifically focused on Windows Terminal. – mklement0 Apr 05 '21 at 20:09
  • It actually addresses the entire thing. Passing the `-nologo` command starts the environment showing just the command line. And answers there cover Windows Terminal, too. – TylerH Mar 23 '23 at 14:59

2 Answers2

21

Update:

  • The answer below shows you to directly edit your settings.json file.

  • As of at least Windows Terminal 1.16, you can alternatively use the GUI:Thanks, Chris

    • Open the Settings tab (e.g. via Ctrl-,)
    • At the bottom of the sidebar on the left, click + Add a new profile, and, next to Duplicate a profile, select your existing PowerShell (Core) profile, then press the Duplicate button.
    • Click on Command line, and modify the existing command line by appending -nologo, as also shown below.

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 startingDirectory and fontFace properties 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 a source property whose value starts with Windows.Terminal, as in the entry shown in your question.

  • There is no strict need for a guid property 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. with New-Guid).

    • If you want to use the same name value as that of the dynamic PowerShell Core profile, it's best to hide the latter by setting its hidden property to true.
  • Custom profiles use a commandline property 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=Off defines 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.exe parent process, but that shouldn't be a problem.
    • You can alternatively define this environment variable persistently, via the registry, in which case cmd.exe is no longer needed.

  • Passing -nologo to PowerShell's CLI suppresses the "logo", i.e. the copyright message and help hint.

    • As of at least PowerShell 7.2.1, -nologo automatically deactivates the update notifications as well - potentially, it has always worked this way.
mklement0
  • 382,024
  • 64
  • 607
  • 775
  • 3
    That worked out perfectly. POWERSHELL_UPDATECHECK is now an environment variable. So the `commandline` is now just `pwsh.exe -nologo`. – AngryHacker Apr 06 '21 at 23:54
  • 2
    As an extension, if you want to hide the logo in a VScode terminal, you can specify `"args": ["-nologo"]` in the `"terminal.integrated.profiles.windows": {"PowerShell": { ... }}` section of your settings json. – LSgeo May 23 '22 at 03:54
1

I wouldn't call this a fix, but in case anybody doesn't want to get into the details of disabling terminal settings, you could just ad clear-host at the end of your code in your profile file, i have mine right at the bottom and it clears the console every time i open it.

Gabriel
  • 87
  • 1
  • 6