From 3623284616688cc7b9788b939b2b05b4c8dfc509 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 25 Aug 2019 14:19:29 +0900 Subject: [PATCH] prompt: fix expansion of \w and \W for PWD=// --- ble-edit.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ble-edit.sh b/ble-edit.sh index 20e86838..e16ebcc7 100755 --- a/ble-edit.sh +++ b/ble-edit.sh @@ -955,8 +955,8 @@ function .ble-line-prompt/update/backslash:w { # PWD .ble-line-prompt/update/append "$param_wd" } function .ble-line-prompt/update/backslash:W { # PWD短縮 - if [[ $PWD == / ]]; then - .ble-line-prompt/update/append / + if [[ ! ${PWD//'/'} ]]; then + .ble-line-prompt/update/append "$PWD" else .ble-line-prompt/update/append "${param_wd##*/}" fi