From 9cd36d3ea1d60ec9b8eea52306f7a55665fbd8f5 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Wed, 23 Dec 2020 16:57:42 -0500 Subject: Switch from 1sh to dash --- home/.shrc | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'home') 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)' -- cgit 1.4.1 d.1'>
path: root/bin/man/pbd.1 (unfollow)
Commit message (Collapse)Author
2018-09-28Add psf2pngJune McEnroe
2018-09-27Add HJKL for moving glyphs to psfedJune McEnroe
2018-09-27Move psfed paste to edit modeJune McEnroe
2018-09-27Export PWDJune McEnroe
Without it, $(PWD) is unset in GNU make.
2018-09-27Add sans6x8 PSF2 fontJune McEnroe
2018-09-26Add copy paste to psfedJune McEnroe
2018-09-25Add r to psfed for invertJune McEnroe
2018-09-24Add psfed, a PSF2 font editorJune McEnroe
2018-09-21Add scheme -i to swap white and blackJune McEnroe
2018-09-21Map caps lock to escape on Linux consoleJune McEnroe
2018-09-19Fix README mandoc lintsJune McEnroe
2018-09-19Un-NOT trans.alpha values in pngoJune McEnroe
2018-09-18Refactor reads in pngo and clear palette between filesJune McEnroe
2018-09-17Add tRNS support to pngoJune McEnroe
2018-09-11Move gfx man pages to gfx/manJune McEnroe
2018-09-11Move bin man pages to bin/manJune McEnroe
2018-09-11Rewrite gfx.7 and render plaintext READMEJune McEnroe
2018-09-11Remove GAMES from BINSJune McEnroe
2018-09-11Rewrite bin.7 and render to plaintext READMEJune McEnroe
2018-09-11Add "blank" lines to man pagesJune McEnroe
2018-09-10Add mdoc syntax fileJune McEnroe
2018-09-08Fix Nm usage in multi-name man pagesJune McEnroe
2018-09-08Put real dates on man pagesJune McEnroe
2018-09-08Replace gfx README with REAMDE.7June McEnroe
2018-09-08Link gfx man pages in ~/.localJune McEnroe