Created
April 2, 2022 22:26
-
-
Save fanurs/475c444ecdce313451b8bba57f0946b1 to your computer and use it in GitHub Desktop.
Exporting the `code` command of VS Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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