From 2c7e9e7ab3a83712b31e91de5e934fa2c41b2be9 Mon Sep 17 00:00:00 2001 From: Alex Thiessen Date: Mon, 4 Feb 2019 23:32:39 +0100 Subject: [PATCH] bash_it.sh: Require interactive shell Previously, a fix was added for bad behavior when `bash-it` printed text to the console in conjunction with protocols like `SCP`, as commit 83c44fac "template/profile: Require interactive shell". It did work for those users who replace their original `~/.bash_profile` file with the one provided by `bash-it`, but not for those who merely append a `bash-it` call to their existing `~/.bash_profile` file. Fix the behavior for the latter case, too. --- bash_it.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bash_it.sh b/bash_it.sh index ab911019..8e2c23d8 100755 --- a/bash_it.sh +++ b/bash_it.sh @@ -1,6 +1,12 @@ #!/usr/bin/env bash # Initialize Bash It +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + # Only set $BASH_IT if it's not already set if [ -z "$BASH_IT" ]; then