Skip to content

Commit

Permalink
edit: support "\$" in PS1 for MSYS2
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Feb 6, 2020
1 parent 500e051 commit b8c2ca6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/edit.sh
Expand Up @@ -203,6 +203,16 @@ function ble-edit/prompt/initialize {
if [[ -e $windir && -w $windir ]]; then
_ble_edit_prompt__string_root='#'
fi
elif [[ $OSTYPE == msys* ]]; then
# msys64/etc/bash.bashrc に倣う
if type id getent &>/dev/null; then
local id getent
ble/util/assign id 'id -G'
ble/util/assign getent 'getent -w group S-1-16-12288'
ble/string#split getent : "$getent"
[[ " $id " == *" ${getent[1]} "* ]] &&
_ble_edit_prompt__string_root='#'
fi
fi
}

Expand Down

0 comments on commit b8c2ca6

Please sign in to comment.