Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using an internal product "shell" based on spring shell. When I press the up arrow to get my last command, instead I get (reverse-i-search)`':

Retrieving the last command works for all my colleagues and so I'm wondering if there may be some setting in my .bash_profile or .bash_functions causing this strange behaviour.

My .bash_functions contains:

cwd3() {
typeset start=${PWD/${HOME}/\~}
typeset delete=${start%/*/*/*}
typeset partial=${start#${delete}/}
if [[ "${partial}" != /* && "${partial}" != \~* ]]
then
    partial="${partial}"
fi
echo "${partial}"
}

and my .bash_profile contains:

#!/bin/bash
echo running .bash_profile

if [ -f $HOME/.bash_functions ]; then
 . $HOME/.bash_functions
fi

if [ -f $HOME/.bash_prompt ]; then
. $HOME/.bash_prompt
fi

if [ -f $HOME/.git-completion ]; then
. $HOME/.git-completion
fi

function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/'
}

function command_exists {
command -v $1 >/dev/null 2>&1
}

function find_cellar {
echo $(brew --cellar $1)/$(brew list --versions $1 | cut -d ' ' -f 2)
}

function find_libexec {
echo $(find_cellar $1)/libexec
}

# Set titles
PS1="\[$Green\]\u\[$Green\]@\[$Green\]\h\[$Green\]:\[$White\]\$(__cwd3)\[$Green\]\$(__git_ps1 ' (%s)')\[$Green\]\$ \[$IGreen\]"

# UNIX Exports
export EDITOR="subl -w"
export HISTCONTROL=erasedups
export HISTSIZE=10000
shopt -s histappend



#Set Java home for hadoop
if [ "$1" == "h" ];
then
echo "setting env up for hadoop"
export JAVA_HOME=$JAVA6_HOME
fi

#set java home for rti4t
if [ "$1" == "r" ];
then
echo "setting env up for RTI4T" 
export JAVA_HOME=$JAVA7_HOME
fi


if command_exists brew; then
export PATH=$(brew --prefix)/bin:$(brew --prefix)/sbin:$(brew --  prefix)/share/npm/bin:$PATH
fi

if command_exists rbenv; then
export RUBY_HOME=$(rbenv prefix)
export PATH=$RUBY_HOME/bin:$PATH
fi



# Enable bash completion
if command_exists brew; then
BASH_COMPLETION_PREFIX=$(brew --prefix)
fi
if [ -f $BASH_COMPLETION_PREFIX/etc/bash_completion ]; then
. $BASH_COMPLETION_PREFIX/etc/bash_completion
fi
if which rbenv &> /dev/null; then eval "$(rbenv init -)"; fi


#THIS MUST BE AT THE END OF THE FILE FOR GVM TO WORK!!!
[[ -s "/Users/duncwinn/.gvm/bin/gvm-init.sh" && ! $(which gvm-init.sh) ]] && source       "/Users/duncwinn/.gvm/bin/gvm-init.sh"

#THIS MUST BE AT THE END OF THE FILE FOR RVM / rbenv TO WORK!!!
eval "$(rbenv init -)"
#[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

Can anyone give me any pointers on what might be causing this strange behaviour.

share|improve this question
    
Try bash --norc. –  Cyrus Jul 12 at 21:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.