Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

General profile settings in Windows Terminal

Feedback

In this article

The settings listed below are specific to each unique profile. If you'd like a setting to apply to all of your profiles, you can add it to thedefaults section above the list of profiles in yoursettings.json file.

"defaults":{    // SETTINGS TO APPLY TO ALL PROFILES},"list":[    // PROFILE OBJECTS]

Profile Ordering

The ordering of profiles in the"list" determines the profile index numbering. This is used to map to the launch key combo, such asCtrl+Shift+1.To change the profile index number, simply cut/paste the profile objects above or below each other.The first in the"list" will map to index 1, hence, it will be assigned to the key combo,Ctrl+Shift+1.

Name

This is the name of the profile that will be displayed in the dropdown menu. This value is also used as the "title" to pass to the shell on startup. Some shells (likebash) may choose to ignore this initial value, while others (Command Prompt,PowerShell) may use this value over the lifetime of the application. This "title" behavior can be overridden by usingtabTitle.

Property name:name

Necessity: Required

Accepts: String



Command line

This is the executable used in the profile.

Property name:commandline

Necessity: Optional

Accepts: Executable file name as a string

Default value:"cmd.exe"

Example: To run a batch file each time cmd.exe is run, set this value to "cmd.exe /k path\to\script.bat"



Starting directory

This is the directory the shell starts in when it is loaded.

Property name:startingDirectory

Necessity: Optional

Accepts: Folder location as a string

Default value:"%USERPROFILE%"

NOTE: When starting directory is not defined, the default value will be set to"%USERPROFILE%" (the path relative to your user settings, for example this may beC:\Users\<your username>). However, if the starting directory is explicitly set tonull, then you will get different results depending on where you launch Terminal.

Example: Start the PowerShell profile in theGitHubRepos folder of yourDocuments directory by finding the powershell.exe profile and adding"startingDirectory": "%USERPROFILE%/Documents/GitHubRepos",

Example with WSL: When setting the starting directory for aLinux distribution installed via WSL, use the format:"startingDirectory": "\\\\wsl$\\DISTRO NAME\\home\\USERNAME", replacing with the placeholders with the proper names of your distribution. For example,"startingDirectory": "\\\\wsl$\\Ubuntu-20.04\\home\\user1". If you are using the Windows Terminal Settings UI, rather than thesettings.json file, to declare this path, you can use theBrowse... button to select your starting directory or enter the WSL path as://wsl.localhost/DISTRO NAME/home/USERNAME. For example,//wsl.localhost/Ubuntu-20.04/home/user1.

Default behavior: When the startingDirectory value is not specified, you will get different results depending on where you launch Terminal:

  • If you run Windows Terminal from the Start menu:%WINDIR%\System32
  • If you run wt.exe from the Start menu:%WINDIR%\System32
  • If you run wt.exe fromWin+R:%USERPROFILE%
  • If you run wt.exe from the explorer address bar: whatever folder you were looking at.

Note

Backslashes need to be escaped. For example,C:\Users\USERNAME\Documents should be entered asC:\\Users\\USERNAME\\Documents.


Icon

This sets the icon that displays within the tab, dropdown menu, jumplist, and tab switcher.

Property name:icon

Necessity: Optional

Accepts: File location as a string, or an emoji

Example: By placing the icon imageubuntu.ico in the folder located at%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\RoamingState, you can display the icon by adding this line to the profile in yoursettings.json:"icon": "ms-appdata:///roaming/ubuntu.ico".

Note

As of Windows Terminal 1.24,icon paths may refer to content adjacent to thesettings.json file.

In the example above, you can placeubuntu.ico in theLocalState directory alongsidesettings.json, and refer to it with"icon": "ubuntu.ico".


___

Tab title

If set, this will replace thename as the title to pass to the shell on startup. Some shells (likebash) may choose to ignore this initial value, while others (Command Prompt,PowerShell) may use this value over the lifetime of the application. If you'd like to learn how to have the shell set your title, visit thetab title tutorial.

Property name:tabTitle

Necessity: Optional

Accepts: String


___

Automatically run as Administrator

If set, this profile will automatically open up in an "elevated" window (running as Administrator) by default. If you run this profile from an unelevated window, then a new elevated terminal window will be created to host this profile. If you launch this profile from an already elevated window, then it will open as a new tab.

When this property is set tofalse, opening this profile in an elevated window will not launch anunelevated window to host this profile. The profile will simply open in the elevated window, running as Administrator.

If you set this property inprofiles.defaults, thenall profiles will launch as Administrator by default, unless overridden by specifically setting this to false.

This property can be overridden in thenewTab andsplitPane actions, with theelevate property.

Elevated and unelevated tabs cannot exist in the same terminal window. For more details, please see theFAQ.

Property name:elevate

Necessity: Optional

Accepts:true,false

Default value:false


___

Hide profile from dropdown

Ifhidden is set totrue, the profile will not appear in the list of profiles. This can be used to hide default profiles and dynamically generated profiles, while leaving them in your settings file. To learn more about dynamic profiles, visit theDynamic profiles page.

Property name:hidden

Necessity: Optional

Accepts:true,false

Default value:false

Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, seeour contributor guide.

Feedback

Was this page helpful?

YesNoNo

Need help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?

  • Last updated on

In this article

Was this page helpful?

YesNo
NoNeed help with this topic?

Want to try using Ask Learn to clarify or guide you through this topic?

Suggest a fix?