Last active
May 9, 2020 10:06
-
-
Save lski/1fcdbe6ffabcce36b84deabc8c9f6bca to your computer and use it in GitHub Desktop.
A way of opening the WT terminal from a WSL terminal in the same directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Opens the current folder in the Windows Terminal | |
function term() { | |
# Open's terminal | |
function __runTerm() { | |
# Using the wslpath tool to convert the current directory to windows format | |
# which is required by wt. Also using printf to escape the characters so they arent expanded | |
local var=$(printf "%q" "$(wslpath -w $(pwd))") | |
# Run wt using powershell command | |
powershell.exe -command wt.exe -d "$var" | |
} | |
# Runs it in the background so that control returns to the current terminal | |
__runTerm &>/dev/null & | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment