From 7257ab62bc715eb00094f75f9d23b3b96dc5d9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Fri, 12 Apr 2024 02:11:55 +0900 Subject: [PATCH] Show admin symbol in cygwin --- bash/rbashrc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bash/rbashrc b/bash/rbashrc index 5052518..b1b62fb 100644 --- a/bash/rbashrc +++ b/bash/rbashrc @@ -290,7 +290,17 @@ function r2dissource { rm -r "$_dis" "$RBASH_SOURCES" } -export PS1="This is ${RHOSTNAME}\e[1;3${RCOLOR}m${RDOMAIN}\e[0m: \w\n\$ " +_SHELLD="\$" +case $OSTYPE in + cygwin) + net session > /dev/null 2>&1 + if [ $? -eq 0 ]; then + _SHELLD="#" + fi + ;; +esac + +export PS1="This is ${RHOSTNAME}\e[1;3${RCOLOR}m${RDOMAIN}\e[0m: \w\n$_SHELLD " export EDITOR=vim export PATH="$RBASH_BIN:$PATH"