Windows Terminal is a modern command-line interface that allows users to streamline PowerShell, Command Prompt, WSL, and Azure Cloud Shells in a unified interface. It allows them to have different profiles with preconfigured environments, defining how specific shells or tools behave.
Adding profiles in Windows Terminal can allow you to seamlessly switch between each shell in one click. In this comprehensive guide, you will learn how to standardize profiles to ensure efficiency and productivity in Windows Terminal.
How to add a profile in Windows Terminal
To add a profile in Windows Terminal on Windows 10, here are two ways you can do it:
Method 1: Using Settings UI
- Open the Windows Terminal app and go to Settings (Ctrl + ,), then select Profiles on the left pane.
- Click the + Add new button below the list to add a profile.
- Set up the new profile by entering a name and commandline. You can also set other features for it, like its starting directory, icon, tab name, appearance, color schemes, and startup behavior.
- After the setup, click Save.
Method 2: Using settings.json
- Select the Open JSON file button or click Settings + hold shift to open settings.json in the default text editor.
- Look for the list array under profiles.
- Add a new JSON block with the following properties:
{
“commandline”: “path-to-shell-executable.exe”,
“guid”: “{GENERATE-A-NEW-GUID}”,
“hidden”: false,
“name”: “Your Profile Name”
}
- After adding the block, configure the profile’s shell path, color scheme, font, and startup settings (See Troubleshooting section below).
- After customizing the new profile, save settings.json and the Windows Terminal will reload automatically. Confirm the added profile in the Settings dropdown menu.
How to remove a profile in Windows Terminal
To delete a profile in Windows Terminal, here are two ways to do it:
Method 1: Using Settings UI
- In the Windows Terminal app, go to Settings (Ctrl + ,), then click Profiles.
- Select the profile you want to delete, then click the Delete profile button, which is in the General settings on the right side.
- Confirm Yes, delete profile, then click Save to apply the changes.
Method 2: Using settings.json
- Go to Settings (Ctrl + ,) in Windows Terminal.
- Select the Open JSON file button or click Settings + hold shift to open settings.json in the default text editor.
- Look for the profiles object and then the list array.
- Each entry in the list array is a profile. Search for the profile you want to delete by removing its name property.
- Delete the {entire profile object} from the list.
- Save the settings.json, then restart Windows Terminal.
WARNING: You cannot delete default profiles like CMD or PowerShell, only custom profiles you have added. However, these profiles can be hidden if the hidden property in settings.json is set to true.
How to customize profiles in Windows Terminal
You can customize profile-specific settings to tailor profiles, making it fit your workflow. You can use the Terminal’s Settings UI to make quick changes or settings.json for bulk customizations and other advanced configurations. Here are the steps you can take:
Using UI for quick changes:
- Go to Settings (Ctrl + ,), choose a profile to tweak, and navigate to Additional settings below.
- Select Appearance to customize background images, themes, fonts, transparency, cursor shapes, and text formatting.
- Select Advanced to make changes in aliasing, bell notifications, and other environment variables.
Using settings.json for bulk edits:
- Hold Settings + hold shift or select Open JSON file to open settings.json.
- Search the list array using the profile’s guid or name, like “name” : “PowerShell” to find the correct block.
- Add or modify codes like “backgroundImage” or “acrylicOpacity” within the profile object:
{
“guid”: “{your-profile-guid}”,
“name”: “PowerShell”,
“backgroundImage”: “C:/Images/dev_bg.png”, // Use forward slashes
“acrylicOpacity”: 0.8
}
Set a default profile when Windows Terminal Opens
You can also choose which profile will automatically show when you open Windows Terminal. It will help you make your workflow much more efficient. Here’s how you can do it:
1. Using the UI:
-
- Open the terminal’s Settings (Ctrl + ,), then go to Startup, where you will find the Default profile setting.
- Select your preferred shell, such as PowerShell, Ubuntu WSL, or CMD.
2. Using settings.json:
-
- Open settings.json (select Settings while holding Shift), then look for the defaultProfile key at the root level.
- Replace the value of the defaultProfile key with the guid of your preferred profile.
Assign keyboard shortcuts for quick profile switching
Assign shortcuts on your keyboard to instantly switch to other profiles, helping you juggle multiple tools. The best way to do this is only through settings.json since the Terminal’s UI is only limited to global shortcuts like Ctrl + T for new tabs. Here’s how you can make hotkey-specific shortcuts for each profile:
- Open settings.json (select Settings while holding Shift), and look for the actions array. If the array does not exist, create it at the root level of the JSON.
- Add a shortcut block for a specific profile’s guid or name:
{
“actions”: [
{
“command”: {
“action”: “newTab”,
“profile”: “Ubuntu-Dev” // Use “profile” or “profileGuid”
},
“keys”: “Ctrl+Shift+U”
} dcreeerfcexwzew4efffffffftc dfgtcttyuyuuiuuuuujj
]
}
Viewing and managing profiles in Windows Terminal
Press Win + X, then select Windows Terminal. The Terminal offers two ways to manage your profiles, which are a user-friendly UI or direct JSON edits. Follow one of the two methods below:
-
Using the General UI:
- Click the dropdown arrow in the title bar and go to Settings (or press Ctrl + ,).
- Navigate to Profiles > List to check installed shells like PowerShell, Command Prompt, and WSL. Default profiles are tagged with (Default).
- Select any profile to adjust the name, command line path, icon, fonts, or color schemes.
- Toggle off Show in profile dropdown to simplify the menus without removing any configurations.
Tip: You can also hover over settings like Acrylic opacity for tips that explain its functions.
-
Advanced customization with Settings.json:
-
- Select Settings in the dropdown menu while holding Shift to open settings.json.
- You can find the Profiles by going to profiles > list.
- Properties that you need to keep in mind are guid (Globally Unique Identifier), name, commandline, and hidden or colorScheme.
- Before you move to the next step, here are tips to keep in mind:
- Copy the file and paste it to a secure location, backing up settings.json before making changes.
- Use the // Comments command to make document changes.
- Confirm JSON syntax with tools like JSONLint.
Troubleshooting Windows Terminal profile issues
Issue: Profile not appearing after adding it
If a Windows Terminal profile is not appearing, look for issues like syntax errors, duplicate guid entries, or invalid shell paths. Here are ways to check:
- Open settings.json (select Settings while holding Shift), then use JSONLint to look for missing commas/brackets.
- Search settings.json for duplicates and run PowerShell to generate unique guids for the profiles.
- Test the commandline of the profiles manually.
- Make sure “hidden” : false is set (or non-existent) in the JSON block.
- Restart Windows Terminal and look for crash warnings in the app.
Issue: Windows Terminal settings not saving
Possible reasons why your Terminal is not saving any settings changes could be due to permission issues or read-only file locks. Close your Windows Terminal, then have it run as administrator and retry the changes.
Issue: Corrupted settings.json file
JSON files usually get corrupted due to manual edits with syntax errors or failed backups. You can resolve this by doing the following methods:
- Replace settings.json with a known-good version, restoring it from backup.
- Reset it to default by renaming or deleting settings.json, then starting Windows Terminal to create a new one.
Best practices for managing Windows Terminal profiles
Check out these strategies to save more time and reduce errors during your profile setups:
Use descriptive profile names for easy identification
Giving your profiles clear and descriptive names can prevent confusion in your Windows Terminal’s system. You can also standardize prefixes as well. For instance, instead of having a profile name like “PowerShell”, go for a unique one like “Prod-PowerShell-7.4 (Admin)”.
Organize profiles using separators or grouped settings
Reduce clutter in your Windows Terminal profiles by grouping them according to their use, or organizing their order according to their usage. In settings.json, add notes like “// —- Development Tools —-” or “// —- Production Tools —-” then put which profile goes into that category.
Backup settings.json regularly
Regularly backing up your settings.json can help prevent or mitigate accidental edits or corruption in the file. You can automate the backup by using a PowerShell script to save daily snapshots:
$settingsPath = “$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_*\LocalState\settings.json”
Copy-Item -Path $settingsPath -Destination “\\network\backups\terminal_$(Get-Date -Format ‘yyyyMMdd’).json”
Experiment with themes and fonts to personalize your experience
Personalizing your Terminal profiles can enhance readability and visual comfort, especially when you are going to spend hours working on the app.
Clean syntax highlights can help you better distinguish different commands, outputs, and errors. Subtle background images or customized transparency can also improve your focus on your work. (see Troubleshooting section).
Frequently Asked Questions (FAQ)
Can I set a default profile in Windows Terminal?
Yes, you can. See how to set a default profile section above on how to do this.
How do I change the shell startup directory for a profile?
You can define a default folder for each specific workflow. In the Settings UI, you can navigate to Settings → [Profile] → General → Starting directory. While for settings.json, Add “startingDirectory”: “C:\\Projects” to the profile’s JSON block and make sure to use Escape backslashes (\\) in JSON paths.
Can I add a Git Bash or custom shell profile?
Yes, you can add them in Windows Terminal.
- To add Git Bash:
-
- Locate its executable file, which is usually at C:\Program Files\Git\bin\bash.exe.
- In settings.json, add the following block:
{
“guid”: “{new-guid}”,
“name”: “Git Bash”,
“commandline”: “(executable file’s address key)”
}
- To add a custom shell path: Replace the profile block’s commandline path with the executable file.
What can I do if I delete a profile by mistake?
If you accidentally delete a file, you can re-add the profile in settings.json with its original guid or regenerate it. If you have a backup, you can restore settings.json’s backup file.
Is Windows Terminal available for Windows 11?
Yes, Windows Terminal is available on Windows 11. It is pre-installed on the operating system or can be downloaded from the Microsoft Store.
Personalize your Windows Terminal profiles
Whether you are using Settings UI or settings.json, you are now equipped with the ability to add, remove, or customize your Windows Terminal profiles. By defining your shell paths, keyboard shortcuts, and personalizing your themes and fonts, the Terminal has now become your productivity hub.
Keep on experimenting with different themes and fonts to help you better focus on your scripts and have the ability to work as long as possible without giving yourself a headache. Just keep in mind that you should always back up your settings.json to stay ahead of any issues.
Organize, categorize, and personalize your Windows Terminal profiles to optimize efficiency in working on your codes.