Skip to content

Instantly share code, notes, and snippets.

@zdyxry
Created June 25, 2022 01:40
Show Gist options
  • Save zdyxry/4faa8e3658a1454f04619a103dd24b78 to your computer and use it in GitHub Desktop.
Save zdyxry/4faa8e3658a1454f04619a103dd24b78 to your computer and use it in GitHub Desktop.
function rcode() {
local target_path="$1"
VSCODE_SERVER_PATH="${HOME}/.vscode-server"
VSCODE_SERVER_BIN_PATH="${VSCODE_SERVER_PATH}/bin"
VSCODE_SERVER_BIN_CURRENT_PATH="${VSCODE_SERVER_BIN_PATH}/$(ls -t ${VSCODE_SERVER_BIN_PATH} | head -n 1)"
VSCODE_IPC_HOOK_CLI=$(ss -l |grep vscode-ipc |tail -n 1 | awk '{print $5}')
VSCODE_IPC_HOOK_CLI=$VSCODE_IPC_HOOK_CLI ${VSCODE_SERVER_BIN_CURRENT_PATH}/bin/remote-cli/code ${target_path}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment