brew install rlwrap
cat >> ~/.bash_profile <<'EOF' alias sqlplus='rlwrap sqlplus' alias rman='rlwrap rman' EOF
source ~/.bash_profile