Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Kapil Gorve
Kapil Gorve

Posted on • Originally published atjskap.com on

     

Windows Terminal Hacks

'cover'Photo by Lewis Ngugi fromPexels

Start Windows Terminal in current folder

We can specify the default directoryWindows Terminal can open in.

  • Open Windows Terminal
  • Go to Settings option or You can pressCtrl + ,. This will open your config file.It should look like this. The first option in list isPowershell 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            },        ]}
Enter fullscreen modeExit fullscreen mode
  • Add"startingDirectory": null option for each profile.
  • Restart Windows Terminal.

Now if you go to any folder and typewt 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 ofnull.

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,}
Enter fullscreen modeExit fullscreen mode
  • 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

By default Windows Terminal will openpowershell in first tab. You can change that usingdefaultProfile property in config.

  • Go to Settings

- Specify"defaultProfile": property to the value ofguid 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        },    ]}}
Enter fullscreen modeExit fullscreen mode

This post was originally published athttps://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 athttps://twitter.com/kapilgorve

Top comments(1)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
lkhrs profile image
Luke Harris
Web designer. Fan of hamburgers that aren't menus.
  • Location
    Texas
  • Work
    Freelancer
  • Joined

I think copy on right-click is on by default, I don't have that in my config and I am able to copy.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Freelance Frontend Developer, ReactJs, NodeJs, React Native.
  • Location
    Pune,India.
  • Joined

More fromKapil Gorve

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp