Windows Terminal Hacks
Tags: windows10
Published: 2020-04-21 17:33:44

---
title: Windows Terminal Hacks
published: true
date: 2020-04-06 00:00:00 UTC
tags: Windows10
canonical_url: https://www.jskap.com/blog/windows-terminal-hacks/
---

!['cover'](https://kapilgorve.s3.ap-south-1.amazonaws.com/blog/covers/terminal.jpg)<sub><sup>Photo by Lewis Ngugi from <a href="https://www.pexels.com/photo/blur-business-close-up-coding-289927/">Pexels</a></sup></sub>

## Start Windows Terminal in current folder[<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#Start-Windows-Terminal-in-current-folder)

We can specify the default directory `Windows Terminal` can open in.

- Open Windows Terminal
- Go to Settings option or You can press `Ctrl + ,`. This will open your config file.It should look like this. The first option in list is `Powershell` config.

```
{
    "profiles":
    {
        "list":
        [
            {
                // Make changes here to the powershell.exe profile
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false,
                "startingDirectory": null
            },
        ]
}
```

- Add `"startingDirectory": null` option for each profile.
- Restart Windows Terminal.

Now if you go to any folder and type `wt` in address bar. This should open Windows Terminal in your current folder. If you want to open it in specific folder,you can specify the path instead of `null`.

## Copy Terminal text[<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#Copy-Terminal-text)

You can't copy text from Windows Terminal by selecting text and right click.

- Go to Settings
- 

Specify `"copyOnSelect": true` at the root of your config file.Ex:

```
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"copyOnSelect": true,
}
```

- Restart Windows Terminal

Now if you select text in terminal and right click. The selected text would be copied to your clipboard.

## Specify default commandline application[<svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>](#Specify-default-commandline-application)

By default Windows Terminal will open `powershell` in first tab. You can change that using `defaultProfile` property in config.

- Go to Settings
- Specify `"defaultProfile":` property to the value of `guid` from list of profiles.
- 

Restart Windows TerminalEx:

```
{
"$schema": "https://aka.ms/terminal-profiles-schema",

"defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"copyOnSelect": true,

"profiles":
{
    "defaults":
    {
        // Put settings here that you want to apply to all profiles
    },
    "list":
    [
        {
            // Make changes here to the powershell.exe profile
            "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
            "name": "Windows PowerShell",
            "commandline": "powershell.exe",
            "hidden": false,
            "startingDirectory": null
        },
        {
            // Make changes here to the cmd.exe profile
            "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
            "name": "cmd",
            "commandline": "cmd.exe",
            "hidden": false,
            "startingDirectory": null
        },
    ]
}
}
```

  

This post was originally published at https://www.jskap.com/blog/windows-terminal-hacks/

  

👋 Hi! I’m Kapil. I am always chatty about building things, sharing my learnings, freelancing. Come say hi to me at [https://twitter.com/kapilgorve](https://twitter.com/kapilgorve)