Windows Subsystem for Linux (WSL)

Microsoft Terminal

Published 2025-08-14.
Time to read: 1 minutes.

This page is part of the wsl collection.

These are my notes on Microsoft Terminal. This free product is the best general-purpose terminal emulator available for Microsoft Windows. I prefer to run the Preview edition; it has never failed me.

Linux Starting Directory

To launch a new terminal session from the same directory as another session, duplicate it by pressing CTRL-SHIFT-D.

Alternatively, you could open a new pane within the same tab, while duplicating the Windows Terminal profile and working directory. To do this, you can either split the session verticallly by pressing ALT-SHIFT-=, or you can split it horizontally by pressing ALT-SHIFT--.

Automatic Tab Titles

Several settings need to be in place before the titles of the tabs will respond to requests from the terminal session.

Microsoft Terminal Settings

The Default profile and the Linux / bash profiles such as Ubuntu must have:

  1. Tab title set to None.
  2. Terminal Emulation / Suppress title changes must be disabled.

The above settings take effect immediately so long as they are not masked by other settings.

Linux Settings

  1. Remove or comment out every line that sets the PS1 and PROMPT_COMMAND environment variables in ~/.bashrc and ~/.profile.
  2. Add the following to ~/.bashrc:
    ~/.bashrc fragment
    RED="\[\033[0;31m\]"
    YELLOW="\[\033[0;33m\]"
    GREEN="\[\033[0;32m\]"
    function parse_git_branch { ref=$(git symbolic-ref HEAD 2> /dev/null) || return echo "("${ref#refs/heads/}")" }
    PS1="$GREEN\h: \u@\h \W $YELLOW\$(parse_git_branch)\n\[\033[00m\]\$ " PROMPT_COMMAND='echo -en "\033]0;$HOSTNAME: $(basename ${PWD/#$HOME/~})\a"'

    The above settings will take effect when a new terminal session starts or when the following command is executed:

    Shell
    $ source ~/.bashrc

The wt.exe Command Line Interface

You can use the wt.exe command-line to perform tasks like open a new tab or pane in the current directory.

For example:

$ wt.exe -w 0 nt -d .

Where:

  1. -w 0 - Specifies to use the current terminal window.
  2. nt or new-tab - Creates a new tab. You can also use sp or split-pane for a new pane.
  3. -d . - Sets the starting directory to the current directory.
* indicates a required field.

Please select the following to receive Mike Slinn’s newsletter:

You can unsubscribe at any time by clicking the link in the footer of emails.

Mike Slinn uses Mailchimp as his marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp’s privacy practices.