Skip to content

Instantly share code, notes, and snippets.

@sandipb
Created January 17, 2024 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandipb/f944e052b8699aac8708528fb8fcd3d0 to your computer and use it in GitHub Desktop.
Save sandipb/f944e052b8699aac8708528fb8fcd3d0 to your computer and use it in GitHub Desktop.
Bash function to use the vs code cli in remote ssh extension
code_remote ()
{
local remote_node_path=$VSCODE_GIT_ASKPASS_NODE;
if [ -z "$remote_node_path" ]; then
echo "VSCODE_GIT_ASKPASS_NODE is not set. Cannot determine path to remote-cli";
return 1;
fi;
local remote_cli_path=$(dirname $remote_node_path)/bin/remote-cli/code;
if [ ! -f "$remote_cli_path" ]; then
echo "Remote CLI not found at $remote_cli_path";
return 1;
fi;
$remote_cli_path "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment