Check $STY rather than $TERM when determining whether screen is running

This commit is contained in:
Chow Loong Jin 2009-07-24 18:39:20 +08:00
commit 8bd62d6ca3
3 changed files with 3 additions and 3 deletions

2
byobu
View file

@ -28,7 +28,7 @@ if [ "$1" = "-v" ]; then
fi
# Nesting byobu inside of screen doesn't work well
if [ ! -z "$STY" ]; then
if [ ! -z $STY ]; then
echo `gettext "Exit the current screen session to run $PKG"`
exit 1
fi

View file

@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
[ "$TERM" = "screen" ] && exit 0
[ -z $STY ] || exit 0
out=`screen -ls 2>/dev/null` || true
if echo "$out" | grep -qsi "^No Sockets found in "; then

View file

@ -130,7 +130,7 @@ setprofile() {
ln -s "$PROFILE_DIR/$x" "$HOME/.$PKG/profile"
found=1
echo
if [ "$TERM" = "screen" ]; then
if [ ! -z $STY ]; then
echo `gettext 'If you are using the default set of keybindings, press\n<F5> to activate these changes.\n\nOtherwise, exit this screen session and start a new one.'`
else
echo `gettext 'Run "byobu" to activate'`