Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Improvements to Fish Shell #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion conf.d/code-connect.fish
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

function _on_code-connect_install --on-event code-connect_install
mkdir -p ~/.code-connect/bin
curl -sS "https://raw.githubusercontent.com/chvolkmann/code-connect/main/bin/code_connect.py" >~/.code-connect/bin/code_connect.py
curl -sS "https://raw.githubusercontent.com/dotaxis/code-connect/main/bin/code_connect.py" >~/.code-connect/bin/code_connect.py
chmod +x ~/.code-connect/bin/code_connect.py
end

Expand Down
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