Permalink
Browse files

Fix EDITOR under tmux.

  • Loading branch information...
1 parent 0331d43 commit ffb0048eea2dd8bcbb5f22da741bea952f345b61 @fnichol committed Apr 21, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 bashrc
View
9 bashrc
@@ -1127,15 +1127,17 @@ cdf() {
# Set the default editor
if [ -z "$SSH_CLIENT" ] ; then # for local/console sessions
- if [[ "$TERM" == screen* ]] ; then # we're in screen or tmux
+ case "$TERM" in
+ screen*|xterm-256color) # we're in screen or tmux
if command -v vim >/dev/null ; then
export EDITOR="$(which vim)"
export BUNDLER_EDITOR="$EDITOR"
else
export EDITOR="$(which vi)"
export BUNDLER_EDITOR="$EDITOR"
fi
- else # we're on a normal term console
+ ;;
+ *) # we're on a normal term console
if command -v mvim >/dev/null ; then
case "$TERM_PROGRAM" in
Apple_Terminal) _terminal="Terminal" ;;
@@ -1157,7 +1159,8 @@ if [ -z "$SSH_CLIENT" ] ; then # for local/console sessions
export EDITOR="$(which vi)"
export BUNDLER_EDITOR="$EDITOR"
fi
- fi
+ ;;
+ esac
else # for remote/ssh sessions
if command -v vim >/dev/null ; then
export EDITOR="$(which vim)"

0 comments on commit ffb0048

Please sign in to comment.