-
-
Save benschweizer/0978d4d93ac8103429519cfd4c69491b to your computer and use it in GitHub Desktop.
open file in vscode remote ssh from a different terminal
This file contains 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
#!/bin/bash | |
set -e | |
set -o pipefail | |
PID=$(lsof -w -c node | grep vscode-ipc | sed -e 's/ */ /g' | cut -d " " -f2 | head -1) | |
NODE=$(readlink -f /proc/$PID/exe) | |
CODE=$(dirname $NODE)/bin/remote-cli/code | |
SOCK=$(lsof -w -c node | grep vscode-ipc | sed -e 's/ */ /g' | cut -d " " -f9 | head -1) | |
export VSCODE_IPC_HOOK_CLI=$SOCK | |
$CODE $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment