Skip to content

Instantly share code, notes, and snippets.

@fanurs
Created April 2, 2022 22:26
Show Gist options
  • Save fanurs/475c444ecdce313451b8bba57f0946b1 to your computer and use it in GitHub Desktop.
Save fanurs/475c444ecdce313451b8bba57f0946b1 to your computer and use it in GitHub Desktop.
Exporting the `code` command of VS Code
# Sometimes when opening a remote terminal in VS Code,
# the command `code` is not found. In such case, we
# can simply add the corresponding directory within
# ~/.vscode-server/ to $PATH.
if ! command -v code &> /dev/null
then
hash_dir=`(cd ~/.vscode-server/bin && ls -trld * && cd ~-) | tail -n1 | awk '{print $NF}'`
export PATH=$PATH:$HOME/.vscode-server/bin/$hash_dir/bin/remote-cli
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment