bash: handle non-interactive sessions, add color settings

This commit is contained in:
Corrado Primier 2020-02-19 12:12:06 +00:00
parent aceb214659
commit 8e66f28b23

24
.bashrc
View File

@ -1,5 +1,12 @@
[ -z "$PS1" ] && return
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
PS1='\[\033[0;37m\][\u@\h $(date +%H:%M) \W]$\[\033[0;0m\] '
[ -z "$PS1" ] && return
if [[ -n "$DISPLAY" ]] ; then
[[ -n "$TMUX" ]] && export TERM=screen-256color || export TERM=xterm-256color
@ -12,12 +19,21 @@ export HISTCONTROL="ignoredups"
export PATH="$PATH:~/bin:~/.gem/ruby/2.3.0/bin"
export WORKON_HOME="~/.virtualenvs"
alias diff="colordiff"
# less colors
export LESS=-R
export LESS_TERMCAP_mb=$'\E[1;31m' # begin blink
export LESS_TERMCAP_md=$'\E[1;36m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink
export LESS_TERMCAP_so=$'\E[01;44;33m' # begin reverse video
export LESS_TERMCAP_se=$'\E[0m' # reset reverse video
export LESS_TERMCAP_ue=$'\E[0m' # reset underline
export LESS_TERMCAP_us=$'\E[1;32m' # begin underline
alias diff="diff --color=auto"
alias grep="grep --color=auto"
alias egrep="egrep --color=auto"
LIB='lib' alias fixsteam="LD_PRELOAD='/usr/$LIB/libstdc++.so.6 /usr/$LIB/libgcc_s.so.1 /usr/$LIB/libxcb.so.1 /usr/$LIB/libgpg-error.so' /usr/bin/steam"
alias gst="git status"
alias ls="ls --color=always"
alias ls="ls --color=auto"
alias l="ls"
alias la="ls -a"
alias ll="ls -l"