URI:
       bash: fix error on ssh/scp - dotfiles - arsenal of config files, ready to be cloned in new (virtual) machines.
  HTML git clone git://git.drkhsh.at/dotfiles.git
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
   DIR README
       ---
   DIR commit bb4c71bddbff2d7cf3d087e6baa8235e45fd03a3
   DIR parent 0f345b054ff76d29eea8b4edb17e400bcbe781c3
  HTML Author: drkhsh <me@drkhsh.at>
       Date:   Fri,  3 Feb 2023 02:39:33 +0100
       
       bash: fix error on ssh/scp
       
       Add is_interactive helper to check for interactive shell before bind
       options.
       
       Diffstat:
         M bash/.bashrc                        |      14 ++++++++++++--
       
       1 file changed, 12 insertions(+), 2 deletions(-)
       ---
   DIR diff --git a/bash/.bashrc b/bash/.bashrc
       @@ -16,6 +16,13 @@ _exists() {
                type $1 > /dev/null 2>&1
        }
        
       +# █▓▒░ is_interactive helper
       +_is_interactive() {
       +        # https://www.gnu.org/software/bash/manual/html_node/Is-this-Shell-Interactive_003f.html
       +        [[ "$-" =~ "i" ]]
       +}
       +
       +
        # █▓▒░ source shared stuff
        [[ -f ~/.env ]] && source ~/.env
        [[ -f ~/.aliases ]] && source ~/.aliases
       @@ -27,7 +34,9 @@ _exists() {
        [[ -f /etc/drkhsh.functions ]] && source /etc/drkhsh.functions
        
        # █▓▒░ general
       -bind 'set bell-style none'
       +if _is_interactive; then
       +        bind 'set bell-style none'
       +fi
        
        # █▓▒░ history
        HISTSIZE=10000
       @@ -44,5 +53,6 @@ fi
        # █▓▒░ starship prompt
        _exists starship && eval "$(starship init bash)"
        
       -# █▓▒░ undefine exists helper
       +# █▓▒░ undefine helpers
        unset -f _exists
       +unset -f _is_interactive