summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-06-29 17:58:22 -0400
committerJune McEnroe <june@causal.agency>2019-06-29 17:58:22 -0400
commitd06f768645f9e8c54443a87389ff0dde21277fa1 (patch)
tree876ddc15a000d0b2c511ea04ca02e1351b07ee5c
parentAdd Parable of the Talents (diff)
downloadsrc-d06f768645f9e8c54443a87389ff0dde21277fa1.tar.gz
src-d06f768645f9e8c54443a87389ff0dde21277fa1.zip
Clean up 1sh prompt setting
-rw-r--r--home/.config/1sh/env.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/home/.config/1sh/env.sh b/home/.config/1sh/env.sh
index 0c645e64..7b87c9d3 100644
--- a/home/.config/1sh/env.sh
+++ b/home/.config/1sh/env.sh
@@ -37,11 +37,17 @@ if [ "$(uname)" = 'Linux' ]; then
 	alias ls='ls --color=auto' grep='grep --color'
 fi
 
+PS0=$'\n'
+PS1='\$ '
+RPS1="${SSH_CLIENT:+\h:}\w"
+
 af0=$(tput setaf 0 || tput AF 0)
 af7=$(tput setaf 7 || tput AF 7)
 sgr0=$(tput sgr0 || tput me)
+tsl=$'\e]0;'
+fsl=$'\a'
 
 PSlit=$'\1'
-[ "${TERM%-*}" = 'xterm' ] && PS0=$'\e]0;\\W\a\n' || PS0=$'\n'
-PS1="${PSlit}${af7}${PSlit}\\\$${PSlit}${sgr0}${PSlit} "
-RPS1="${PSlit}${af0}${PSlit}# ${PSlit}${af7}${PSlit}\\w${PSlit}${sgr0}${PSlit}"
+PS1="${PSlit}${af7}${PSlit}${PS1% }${PSlit}${sgr0}${PSlit} "
+RPS1="${PSlit}${af0}${PSlit}# ${PSlit}${af7}${PSlit}${RPS1}${PSlit}${sgr0}${PSlit}"
+[ "${TERM%-*}" = 'xterm' ] && PS0="${tsl}${SSH_CLIENT:+\h:}\W${fsl}${PS0}"
d>2018-09-13Add IRCDefault to colors enumJune McEnroe 2018-09-13Return a format->split even at the end of the stringJune McEnroe 2018-09-13Fix weird tab-complete after commaJune McEnroe 2018-09-13Rewrite UI againJune McEnroe 2018-09-12Add note about C-oJune McEnroe 2018-09-12Use formatParse split to position input cursorJune McEnroe 2018-09-12Factor out IRC formatting parsingJune McEnroe 2018-09-11Add /help equivalent to /manJune McEnroe 2018-09-11Don't render every PM as a pingJune McEnroe 2018-09-11Add urlOpenMatchJune McEnroe 2018-09-10Depend on man.sh for chroot.tar targetJune McEnroe 2018-09-10Set LESSSECURE=1 in man.shJune McEnroe 2018-09-10Add /man commandJune McEnroe 2018-09-10Install man page in chrootJune McEnroe 2018-09-10Install man pageJune McEnroe 2018-09-10Split keys into subsections and document colorsJune McEnroe 2018-09-10Add "blank" lines to chatte.1June McEnroe 2018-09-10Document key bindings in chatte.1June McEnroe 2018-09-08Document slash commands in chatte.1June McEnroe