From 8905707626f49611e6853c3595996416b7c42864 Mon Sep 17 00:00:00 2001 From: Kazutoshi Horie Date: Fri, 11 Jul 2025 11:39:36 +0900 Subject: [PATCH 1/2] Use zsh builtin expansion to resolve config dir --- .config/zsh/zshrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.config/zsh/zshrc b/.config/zsh/zshrc index ff5ecde..f1a3dfc 100644 --- a/.config/zsh/zshrc +++ b/.config/zsh/zshrc @@ -1,5 +1,8 @@ # directory fullpath of this file -FILE_DIR="$(cd "$(dirname "${(%):-%N}")" && pwd)" +# Use zsh's built in path expansion to resolve the directory that +# contains this file. This avoids relying on `cd` and `dirname`, which +# can misbehave in some environments such as VSCode. +FILE_DIR=${${(%):-%N}:A:h} alias ls="ls -hlp --color" alias lsa="ls -a" From 71deb77050cb244c9ffc1c131fd1269629e45c3a Mon Sep 17 00:00:00 2001 From: Kazutoshi Horie Date: Fri, 11 Jul 2025 11:42:55 +0900 Subject: [PATCH 2/2] Update .config/zsh/zshrc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .config/zsh/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/zsh/zshrc b/.config/zsh/zshrc index f1a3dfc..5950bfb 100644 --- a/.config/zsh/zshrc +++ b/.config/zsh/zshrc @@ -2,7 +2,7 @@ # Use zsh's built in path expansion to resolve the directory that # contains this file. This avoids relying on `cd` and `dirname`, which # can misbehave in some environments such as VSCode. -FILE_DIR=${${(%):-%N}:A:h} +FILE_DIR="${${(%):-%N}:A:h}" alias ls="ls -hlp --color" alias lsa="ls -a"