X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/1e8b505fee84d2952bd24f7a04b1cd8ed1300ee2..aa6eb0dd5935f5aac2e2cbc251477540e6415229:/dot/shell-rc diff --git a/dot/shell-rc b/dot/shell-rc index d6a218a..ea4f575 100644 --- a/dot/shell-rc +++ b/dot/shell-rc @@ -67,6 +67,28 @@ __mdw_hqual=$__mdw_hqual${SCHROOT_CHROOT_NAME+/$SCHROOT_CHROOT_NAME} __mdw_hqual=$__mdw_hqual${CROSS_BUILDENV+/$CROSS_BUILDENV} __mdw_set_prompt_hacks () { host=$__mdw_host; dir=""; } +__mdw_system=$(uname -s) +: ${USER-${LOGNAME-$(id -un)}} +__mdw_user=$USER + +case $(id -u) in + 0) + __mdw_rootp=t + ;; + *) + case $__mdw_system in + CYGWIN_*) + case " $(id -G) " in + *" 544 "*) __mdw_rootp=t __mdw_user="$__mdw_user%admin" ;; + *) __mdw_rootp=nil ;; + esac + ;; + *) + __mdw_rootp=nil + ;; + esac +esac + __mdw_set_prompt_pieces () { ## Fancy highlighting in some terminals. @@ -78,17 +100,16 @@ __mdw_set_prompt_pieces () { ## Choose the right delimiters. Highlight root prompts specially; ## highlight when I'm running as some other user. Highlight when this ## isn't the outermost shell on the terminal. - local left right user u tty - user=${USER-${LOGNAME-$(id -un)}} - case $(id -u) in - 0) + local left right u tty + case $__mdw_rootp in + t) left=$(echo « | iconv -f UTF-8 -t //translit) right=$(echo » | iconv -f UTF-8 -t //translit) ;; - *) - case $user in + nil) + case $USER in mdw | mwooding | nemo) u="" left="[" right="]" ;; - *) u="$user@" left="{" right="}" ;; + *) u="$__mdw_user@" left="{" right="}" ;; esac tty=$(tty) case "$__mdw_tty" in @@ -148,7 +169,7 @@ __mdw_set_prompt () { __mdw_xterm_settitle () { printf >/dev/tty \ "]2;%s@%s:%s – %s\\" \ - "$USER" "$__mdw_host" "$PWD" \ + "$__mdw_user" "$__mdw_host$__mdw_hqual" "$PWD" \ "$1" } __mdw_xterm_precmd () { __mdw_xterm_settitle "$__mdw_shell"; } @@ -200,6 +221,12 @@ alias make="nice make" alias cross-run="nice cross-run" alias gdb="gdb -q" +## Shut up Lisp interpreters. +alias clisp="clisp -q -q" +alias cmucl="rlwrap cmucl -quiet" +alias ecl="rlwrap ecl" +alias sbcl="rlwrap sbcl --noinform" + ###-------------------------------------------------------------------------- ### Colour output.