diff --git a/home/.chezmoitemplates/nushell/config.nu.tmpl b/home/.chezmoitemplates/nushell/config.nu.tmpl index b7d3857..05be0d7 100644 --- a/home/.chezmoitemplates/nushell/config.nu.tmpl +++ b/home/.chezmoitemplates/nushell/config.nu.tmpl @@ -1044,4 +1044,15 @@ def maestroOn [] { bluetoothctl unblock "AC:BF:71:66:FE:B2" bluetoothctl connect "AC:BF:71:66:FE:B2" } -{{ end }} \ No newline at end of file +{{ end }} + +{{- if .wsl }} +# Launch Windows Terminal in current directory +def wt [...args: string] { + if ($args | is-empty) { + ^wt.exe -w 0 sp wsl --cd (pwd) + } else { + ^wt.exe -w 0 ...$args wsl --cd (pwd) + } +} +{{- end }} \ No newline at end of file diff --git a/home/.chezmoitemplates/scripts/commonrc.fish.tmpl b/home/.chezmoitemplates/scripts/commonrc.fish.tmpl index 17710e6..33ccff0 100644 --- a/home/.chezmoitemplates/scripts/commonrc.fish.tmpl +++ b/home/.chezmoitemplates/scripts/commonrc.fish.tmpl @@ -106,4 +106,13 @@ test -x /mnt/c/Users/Xevion/AppData/Local/Programs/cursor/resources/app/bin/curs # Zed Editor CLI (Windows installation accessible from WSL) test -x /mnt/c/Users/Xevion/AppData/Local/Programs/Zed/bin/zed && \ fish_add_path /mnt/c/Users/Xevion/AppData/Local/Programs/Zed/bin + +# Launch Windows Terminal in current directory +function wt + if test (count $argv) -eq 0 + wt.exe -w 0 sp wsl --cd (pwd) + else + wt.exe -w 0 $argv wsl --cd (pwd) + end +end {{- end }} diff --git a/home/.chezmoitemplates/scripts/commonrc.sh.tmpl b/home/.chezmoitemplates/scripts/commonrc.sh.tmpl index dab1ded..539d801 100644 --- a/home/.chezmoitemplates/scripts/commonrc.sh.tmpl +++ b/home/.chezmoitemplates/scripts/commonrc.sh.tmpl @@ -109,6 +109,15 @@ export BROWSER='powershell.exe /c start' # Zed Editor CLI (Windows installation accessible from WSL) [ -x /mnt/c/Users/Xevion/AppData/Local/Programs/Zed/bin/zed ] && \ export PATH="$PATH:/mnt/c/Users/Xevion/AppData/Local/Programs/Zed/bin" + +# Launch Windows Terminal in current directory +wt() { + if [ $# -eq 0 ]; then + wt.exe -w 0 sp wsl --cd "$(pwd)" + else + wt.exe -w 0 "$@" wsl --cd "$(pwd)" + fi +} {{- end }} # dotnet diff --git a/home/Documents/PowerShell/Microsoft.PowerShell_profile.ps1.tmpl b/home/Documents/PowerShell/Microsoft.PowerShell_profile.ps1.tmpl index e05adda..6f11195 100644 --- a/home/Documents/PowerShell/Microsoft.PowerShell_profile.ps1.tmpl +++ b/home/Documents/PowerShell/Microsoft.PowerShell_profile.ps1.tmpl @@ -39,6 +39,18 @@ Set-Alias -Name ch -Value chezmoi function cha { chezmoi apply --interactive } function chlg { lazygit --path {{ .chezmoi.config.sourceDir }} } +# ---------------------- +# Windows Terminal +# ---------------------- +# Launch Windows Terminal in current directory +function wt { + if ($args.Count -eq 0) { + wt.exe -w 0 sp wsl --cd $PWD.Path + } else { + wt.exe -w 0 $args wsl --cd $PWD.Path + } +} + # ---------------------- # Git Aliases # ----------------------