From 5028478ebc8953081db62701bb9f56be57b44c7d Mon Sep 17 00:00:00 2001 From: Aeredren <57669973+Aeredren@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:15:38 +0100 Subject: [PATCH] If not interactive, do nothing When the shell is not an interactive shell, return from the bashrc directly. Avoid sourcing unnecessary config for a shell you'll never see. --- sensible.bash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sensible.bash b/sensible.bash index a306610..9f4eadd 100644 --- a/sensible.bash +++ b/sensible.bash @@ -3,6 +3,11 @@ # Repository: https://github.com/mrzool/bash-sensible # Version: 0.2.2 +# If shell is not interactive: do nothing +if [[ $- != *i* ]] ; then + return +fi + # Unique Bash version check if ((BASH_VERSINFO[0] < 4)) then