git.fiddlerwoaroof.com
Browse code

make iterm integration only activate in iterm

Ed L authored on 03/03/2018 19:25:42
Showing 1 changed files
... ...
@@ -122,13 +122,15 @@ if [[ -o interactive ]]; then
122 122
     # If hostname -f is slow on your system, set iterm2_hostname prior to sourcing this script.
123 123
     [[ -z "$iterm2_hostname" ]] && iterm2_hostname=`hostname -f`
124 124
 
125
-    [[ -z $precmd_functions ]] && precmd_functions=()
126
-    precmd_functions=($precmd_functions iterm2_precmd)
125
+    if [[ "$TERM_PROGRAM" = "iTerm.app" ]]; then 
126
+      [[ -z $precmd_functions ]] && precmd_functions=()
127
+      precmd_functions=($precmd_functions iterm2_precmd)
127 128
 
128
-    [[ -z $preexec_functions ]] && preexec_functions=()
129
-    preexec_functions=($preexec_functions iterm2_preexec)
129
+      [[ -z $preexec_functions ]] && preexec_functions=()
130
+      preexec_functions=($preexec_functions iterm2_preexec)
130 131
 
131
-    iterm2_print_state_data
132
-    printf "\033]1337;ShellIntegrationVersion=5;shell=zsh\007"
132
+      iterm2_print_state_data
133
+      printf "\033]1337;ShellIntegrationVersion=5;shell=zsh\007"
134
+    fi
133 135
   fi
134 136
 fi