summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--home/.shrc28
1 files changed, 15 insertions, 13 deletions
diff --git a/home/.shrc b/home/.shrc
index 78d9e9f3..bf3e0dfe 100644
--- a/home/.shrc
+++ b/home/.shrc
@@ -1,6 +1,5 @@
 set -o noclobber -o nounset -o vi
 
-HISTFILE=~/.history
 CDPATH=:~
 
 alias vim=$EDITOR
@@ -20,15 +19,15 @@ type doas >/dev/null 2>&1 && alias sudo=doas
 cd() {
 	local path
 	if [ $# -eq 0 ]; then
-		builtin cd
+		command cd
 	elif [ "${1%%:*}" != "$1" ]; then
 		path=${1#*:}
 		[ -n "${path}" ] || path=${PWD#${HOME}/}
 		SSH_CD=$path ssh -o SendEnv=SSH_CD "${1%%:*}"
 	elif [ -e "$1" -a ! -d "$1" ]; then
-		builtin cd "${1%/*}" && $EDITOR "${1##*/}"
+		command cd "${1%/*}" && $EDITOR "${1##*/}"
 	else
-		builtin cd "$@"
+		command cd "$@"
 	fi
 }
 if [ -n "${SSH_CD:-}" ]; then
@@ -36,12 +35,15 @@ if [ -n "${SSH_CD:-}" ]; then
 	unset SSH_CD
 fi
 
-PS0=$'\n'
-PS1='\$ '
-RPS1="\? ${SSH_CLIENT:+\h:}\w"
-
-if [ "${TERM%-*}" = 'xterm' ]; then
-	tsl=$'\e]0;'
-	fsl=$'\e\\'
-	PS0="${tsl}${SSH_CLIENT:+\h:}\W${fsl}${PS0}"
-fi
+hostname=$(hostname -s)
+rprompt() {
+	local pwd
+	pwd=${PWD#${HOME}}
+	[ "${pwd}" != "${PWD}" ] && pwd="~${pwd}"
+	[ "${TERM%-*}" = 'xterm' ] \
+		&& printf '\33]0;%s\a' "${SSH_CLIENT:+${hostname}:}${pwd##*/}" >&2
+	printf '%s' "${SSH_CLIENT:+${hostname}:}${pwd}"
+}
+PS1='
+$ '
+RPS1='${?#0} $(rprompt)'
ea03c0&follow=1'>ui-blob: return 'application/octet-stream' for binary blobsLars Hjemli 2009-07-25ui-plain: Return 'application/octet-stream' for binary files.Remko Tronçon 2009-06-11use cgit_httpscheme() for atom feedDiego Ongaro 2009-06-11add cgit_httpscheme() -> http:// or https://Diego Ongaro 2009-06-07Return http statuscode 404 on unknown branchLars Hjemli 2009-06-07Add head-include configuration option.Mark Lodato 2009-03-15CGIT 0.8.2.1Lars Hjemli 2009-03-15Fix doc-related glitches in Makefile and .gitignoreLars Hjemli 2009-03-15ui-snapshot: avoid segfault when no filename is specifiedLars Hjemli 2009-03-15fix segfault when displaying empty blobsEric Wong 2009-02-19Add support for HEAD requestsLars Hjemli 2009-02-19Add support for ETag in 'plain' viewLars Hjemli 2009-02-12ui-tree: escape ascii-text properly in hexdump viewLars Hjemli 2009-02-12Makefile: add doc-related targetsLars Hjemli