Skip to content

Instantly share code, notes, and snippets.

@Habetdin
Last active March 4, 2019 10:27
Show Gist options
  • Save Habetdin/c22007ca85317f9b29551e9272db5bb4 to your computer and use it in GitHub Desktop.
Save Habetdin/c22007ca85317f9b29551e9272db5bb4 to your computer and use it in GitHub Desktop.
Bash Tweaks
# don't put duplicate lines or lines starting with space in the history
HISTCONTROL=ignoreboth:erasedups
# append to the history file, don't overwrite it
shopt -s histappend
# don't execute expanded result immediately
shopt -s histverify
# https://unix.stackexchange.com/a/18443
PROMPT_COMMAND="history -n; history -w; history -c; history -r; $PROMPT_COMMAND"
if [ -z "$TMUX" ]; then
if [[ $- =~ i ]] && shopt -q login_shell; then
#[[ $(ps -p $PPID -o comm=) =~ sshd ]] && \
tmux attach || tmux new
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment