From 2340b43045445b87a97edd480d10789f517bea72 Mon Sep 17 00:00:00 2001 From: Chase Taylor <11805686+dotaxis@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:35:54 -0700 Subject: [PATCH] Add SSH session check for fish --- functions/code.fish | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/functions/code.fish b/functions/code.fish index aba04ed..0e09f5c 100755 --- a/functions/code.fish +++ b/functions/code.fish @@ -5,10 +5,13 @@ function code --description 'Run local code exectuable if installed, run code-connect otherwise' set -l local_code_executable (which code 2>/dev/null) if test -n "$local_code_executable" - # code is in the PATH, use that binary instead of the code-connect - $local_code_executable $argv - else - # code not locally installed, use code-connect - code-connect $argv + if not test -n "$SSH_CLIENT" && not test -n "$SSH_TTY" + # code is in the PATH and we're not in an SSH session, use that binary instead of the code-connect + $local_code_executable $argv + return + end end + + # code not locally installed, use code-connect + code-connect $argv end