tenseleyflow/gump / 782e20d

Browse files

simplify zsh command detection with whence

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
782e20d1ea35cac30cea97078efa97218d0d51d2
Parents
745cb7e
Tree
e74bd16

1 changed file

StatusFile+-
M src/cmd/init.rs 2 10
src/cmd/init.rsmodified
@@ -184,16 +184,8 @@ __gump_accept_line() {
184184
         return
185185
     fi
186186
 
187
-    # Skip if command exists (use whence for comprehensive check)
188
-    if whence -p "$first_word" >/dev/null 2>&1 || \
189
-       (( $+functions[$first_word] )) || \
190
-       (( $+aliases[$first_word] )) || \
191
-       [[ "$first_word" == "." ]] || \
192
-       [[ "$first_word" == "source" ]] || \
193
-       [[ "$first_word" == "cd" ]] || \
194
-       [[ "$first_word" == "exit" ]] || \
195
-       [[ "$first_word" == "exec" ]] || \
196
-       [[ "$first_word" == "eval" ]]; then
187
+    # Skip if command exists (whence checks builtins, functions, aliases, and PATH)
188
+    if whence "$first_word" >/dev/null 2>&1; then
197189
         zle .accept-line
198190
         return
199191
     fi