Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions functions/code.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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