diff --git a/.bashrc-reit b/.bashrc-reit
index 50fcaf51553190a1269a1f4d25280abe74463a6e..3ab62c5a456b237f224d05f882b8fe201889c28a 100644
--- a/.bashrc-reit
+++ b/.bashrc-reit
@@ -50,14 +50,18 @@ alias docker-prune='sudo docker rm $(sudo docker images -q) -f && sudo docker sy
 # Append to the history file, don't overwrite it
 shopt -s histappend
 
-# Search history configuration
-# Configure key bindings for history search backward and forward
-bind '"\e[A": history-search-backward'   # Up arrow key
-bind '"\e[B": history-search-forward'    # Down arrow key
-bind '"\eOA": history-search-backward'   # Up arrow key in some terminals
-bind '"\eOB": history-search-forward'    # Down arrow key in some terminals
-bind '"^E" end-of-line'                  # Ctrl+E for end of line
-bind '"^A" start-of-line'                # Ctrl+A for start of line
+
+# Check if the shell is interactive before setting up line editing
+if [[ -n "$PS1" ]]; then
+    # Search history configuration
+    # Configure key bindings for history search backward and forward
+    bind '"\e[A": history-search-backward'   # Up arrow key
+    bind '"\e[B": history-search-forward'    # Down arrow key
+    bind '"\eOA": history-search-backward'   # Up arrow key in some terminals
+    bind '"\eOB": history-search-forward'    # Down arrow key in some terminals
+    bind '"^E" end-of-line'                  # Ctrl+E for end of line
+    bind '"^A" start-of-line'                # Ctrl+A for start of line
+fi
 
 HISTSIZE=100000                                # Maximum number of lines kept in memory for the history list
 HISTFILESIZE=100000                            # Maximum number of lines saved in the history file