From 3d23d92fbf5ad8b45cdcd34ee8ca6f788e400ae1 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Fri, 1 Mar 2013 02:14:11 +0100 Subject: [PATCH] Fix the default shell Go with whatever is set by SSH, and fall back to "linux" if the terminal is not available. This fixes #1975 --- packages/devel/ncurses/install | 6 ++++-- packages/sysutils/bash/profile.d/shell.conf | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/packages/devel/ncurses/install b/packages/devel/ncurses/install index a6c15d1b27..883ff9b267 100755 --- a/packages/devel/ncurses/install +++ b/packages/devel/ncurses/install @@ -36,6 +36,10 @@ TERMINFO=$INSTALL/usr/share/terminfo $ROOT/$TOOLCHAIN/bin/tic -xe linux \ $PKG_BUILD/misc/terminfo.src + mkdir -p $INSTALL/usr/share/terminfo/s + TERMINFO=$INSTALL/usr/share/terminfo $ROOT/$TOOLCHAIN/bin/tic -xe screen \ + $PKG_BUILD/misc/terminfo.src + mkdir -p $INSTALL/usr/share/terminfo/v TERMINFO=$INSTALL/usr/share/terminfo $ROOT/$TOOLCHAIN/bin/tic -xe vt100 \ $PKG_BUILD/misc/terminfo.src @@ -45,5 +49,3 @@ $PKG_BUILD/misc/terminfo.src TERMINFO=$INSTALL/usr/share/terminfo $ROOT/$TOOLCHAIN/bin/tic -xe xterm-color \ $PKG_BUILD/misc/terminfo.src - TERMINFO=$INSTALL/usr/share/terminfo $ROOT/$TOOLCHAIN/bin/tic -xe vt100 \ - $PKG_BUILD/misc/terminfo.src diff --git a/packages/sysutils/bash/profile.d/shell.conf b/packages/sysutils/bash/profile.d/shell.conf index 468a3bb085..5081c35522 100644 --- a/packages/sysutils/bash/profile.d/shell.conf +++ b/packages/sysutils/bash/profile.d/shell.conf @@ -26,5 +26,21 @@ PS1='\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] ' export PS1 -TERM="linux" +case "$TERM" in + + # Do nothing when TERM already set (e.g. by SSH) and known + (linux|nxterm|screen|vt100|vt100-am|xterm|xterm-color) + ;; + + # Default to "linux" when unset + ("") + TERM="linux" + ;; + + # Default to "xterm" when unknown + (*) + TERM="xterm" + ;; + +esac export TERM \ No newline at end of file