Skip to content

Instantly share code, notes, and snippets.

@mrk21
Last active November 26, 2021 05:10
Show Gist options
  • Save mrk21/528ba36c50f4d80320b11cb61969f71a to your computer and use it in GitHub Desktop.
Save mrk21/528ba36c50f4d80320b11cb61969f71a to your computer and use it in GitHub Desktop.
This `code` command is for containers, and it can also execute on terminals other than vscode
#!/bin/bash
# This `code` command is for containers, and it can also execute on terminals other than vscode.
# If you use it, you must execute it after attaching the container in vscode.
# see: VSCode Remote SSHで別Shellからファイルを開く https://zenn.dev/shirou/articles/vscode-remote-open-file
export VSCODE_IPC_HOOK_CLI=$(ls -t /tmp/vscode-ipc-*.sock | head -1)
CODE=$(ls -t ~/.vscode-server/bin/*/bin/code | head -1)
exec ${CODE} $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment