mirror of
https://github.com/notwa/rc
synced 2024-11-05 08:29:02 -08:00
49 lines
1.1 KiB
Bash
49 lines
1.1 KiB
Bash
[ -z "$PS1" ] && return
|
|
|
|
if [ "$TERM" = rxvt-unicode-256color ]; then
|
|
export TERM=xterm-256color
|
|
fi
|
|
|
|
HISTCONTROL=erasedups
|
|
HISTSIZE=1000
|
|
HISTFILESIZE=2000
|
|
|
|
shopt -s histappend
|
|
shopt -s checkwinsize
|
|
#shopt -s physical # chaselinks (doesn't exist?)
|
|
set -o hashall # enable hash command
|
|
|
|
if [[ "$TERM" = xterm* ]]; then
|
|
_title="\[\033]2;\w\a\]"
|
|
else
|
|
_title=""
|
|
fi
|
|
|
|
Csucc=$'\\[\e[42m\\]'
|
|
Cfail=$'\\[\e[41m\\]'
|
|
_line1=$' \\[\e[0m\\]'
|
|
_line2=$'\\[\e[1;37m\\]\\$\\[\e[0m\\] '
|
|
ret_succ="$_title${Csucc}$_line1\n${Csucc}$_line2"
|
|
ret_fail="$_title${Cfail}$_line1\n${Cfail}$_line2"
|
|
|
|
PROMPT_COMMAND='[ $? = 0 ] && PS1=${ret_succ} || PS1=${ret_fail}'
|
|
|
|
. ~/.-shrc
|
|
|
|
alias pl="printf '%s\n'"
|
|
|
|
# this doesn't work for all scripts at the moment, but
|
|
ADDPATH "$HOME/sh"
|
|
|
|
(
|
|
cd ~/sh \
|
|
&& printf "%s\n" '#!/usr/bin/env false' '[ "${SOURCING:-0}" -gt 0 ] || exit 1' '' \
|
|
| cat - $(grep -lF 'YES_BASH' $(find ~/sh -maxdepth 1 -type f)) \
|
|
> ~/.sh-bash
|
|
)
|
|
|
|
: $((SOURCING+=1))
|
|
. ~/.sh-bash
|
|
: $((SOURCING-=1))
|
|
|
|
alias reload='cd; exec bash' ### @- **TODO:** respect initctl like in `.zshrc`.
|