Sublime Forum

Solution: Open repository in terminal (Windows Terminal and others)

#1

Hey guys,

Just wanted to share with you a solution to open current repository in the new Windows Terminal on Windows 10. The solution should work with small modifications on any system. But in Windows 10 there have been a blocker with permission errors for the wt alias until now.

It´s patched together from earlier comments in this forum and git issues so the credit goes to the respective authors. Also, the windows terminal usage was made possible due to this recently resolved issue by the git team.

  1. Install the latest git for windows. 2.31.1 or higher is required (containing the fix for issue 2675).

  2. Configure Sublime merge to use the system git instead of bundled

    Preferences > Advanced > Git binary > Set to System
    
  3. Add this alias to your ~\.gitconfig

    [alias]
    openterminalatpath = "!f() { wt -d \"$1\" ; }; f"
    
  4. Add a command to sublime merge to open the alias.

    Browse Packages > Open file: Default.sublime-commands
    

    add the following command

    [
        { 
            "caption": "Open Repository in Terminal", 
            "command": "git", 
            "args": {
                "argv": ["openterminalatpath", "$working_dir"]
            }
        }
    ]
    
  5. Use the command by pressing ctrl+p then searching for Open repository in Terminal

2 Likes

Launch Terminal/Command Line at repo path
#2

Since there is a built in GIT with Sublime Merge, isn’t there a simple option to open Git Terminal on the current folder?

0 Likes

#3

As far as I know, there is now way yet. I think they are working on it but if you see the links in the text to older forum posts and github issues it has been a requested feature for some time.

This is just a workaround until it´s done.

0 Likes