From a8dc1eff5b02e0e53012bebc39c8df5745274bc9 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Fri, 5 Nov 2021 15:46:29 -0500 Subject: fix: fixed issue with wt startup dir (again) --- shell/wsl.sh | 6 +++--- wt.json | 3 +-- zshrc | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/shell/wsl.sh b/shell/wsl.sh index 06e2d7e..7fe3368 100644 --- a/shell/wsl.sh +++ b/shell/wsl.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -WINHOME="$(wslpath "$(powershell.exe -NoProfile -c \$HOME)")" - +WINHOME="/mnt/c/Users/$USER" +[ "$PWD" = "$WINHOME" ] && cd # XDG Specs export XDG_DESKTOP_DIR="$WINHOME/Desktop" export XDG_DOCUMENTS_DIR="$WINHOME/Documents" @@ -52,7 +52,7 @@ wsl_cmd_proxy() { esac args+=" " done - + powershell.exe -NoProfile -c 'cd $HOME;' "$exe" "$cmd" "$args" } diff --git a/wt.json b/wt.json index f243ed2..041ea1a 100644 --- a/wt.json +++ b/wt.json @@ -97,8 +97,7 @@ "guid": "{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}", "hidden": false, "name": "Debian", - "source": "Windows.Terminal.Wsl", - "startingDirectory": null + "source": "Windows.Terminal.Wsl" }, { "commandline": "ssh heimdall", diff --git a/zshrc b/zshrc index da3ea4a..51de715 100644 --- a/zshrc +++ b/zshrc @@ -1,6 +1,6 @@ #!/usr/bin/env zsh -[ "$PWD" = '/mnt/c/Windows' ] && cd + if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" @@ -10,6 +10,7 @@ export DOTFILES="${HOME}/dotfiles" # Directory hashtable hash -d .=${HOME}/dotfiles +[ -n "${WSL_DISTRO_NAME+1}" ] && source $DOTFILES/zsh/wsl.zsh source $DOTFILES/shell/env.sh source $DOTFILES/zsh/plugins.zsh source $DOTFILES/zsh/setopt.zsh @@ -17,4 +18,3 @@ source $DOTFILES/zsh/prompt.zsh source $DOTFILES/zsh/aliases.zsh source $DOTFILES/zsh/completions.zsh source $DOTFILES/zsh/keybindings.zsh -[ -n "${WSL_DISTRO_NAME+1}" ] && source $DOTFILES/zsh/wsl.zsh -- cgit v1.2.3-70-g09d2