首页 > 解决方案 > ununtu bash session exiting on using tab key or some error commands

问题描述

Team, I am unable to catch this that only on first time when i issue a TAB key for command completion or any command that results in stderr, my bash session exits. When i login again and do the same exact it does not. Then after like some time, i start to the same exit behavour. Not sure what is wrong. In my ~/bashrc I have follwing info.

My scenario is I ssh from my macbook to a linux ubuntu and then i execute commands.

cat ~/.bashrc | grep PS
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
export PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \[\033[0;36m\]\h \w\[\033[0;32m\]$(__git_ps1)\n\[\033[0;32m\]└─\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\] ▶\[\033[0m\] '

cat ~/.bashrc | grep set
# set a fancy prompt (non-color, unless we know we "want" color)
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # a case would tend to support setf rather than setaf.)
unset color_prompt force_color_prompt
 env | grep set
_VIRTUALENVWRAPPER_API= mkvirtualenv rmvirtualenv lsvirtualenv showvirtualenv workon add2virtualenv cdsitepackages cdvirtualenv lssitepackages toggleglobalsitepackages cpvirtualenv setvirtualenvproject mkproject cdproject mktmpenv mkvirtualenv rmvirtualenv lsvirtualenv showvirtualenv workon add2virtualenv cdsitepackages cdvirtualenv lssitepackages toggleglobalsitepackages cpvirtualenv setvirtualenvproject mkproject cdproject mktmpenv
env | grep PS
PS1=\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \[\033[0;36m\]\h \w\[\033[0;32m\]$(__git_ps1)\n\[\033[0;32m\]└─\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\] ▶\[\033[0m\]

标签: bashshellubuntu-16.04

解决方案


推荐阅读