···33# Sets EDITOR and related variables to use VS Code instead of firing up nano (or worse vi),
44# based on env var detection of VSCODE_* vars.
5566-if [[ -n $VSCODE_IPC_HOOK_CLI && -n $VSCODE_GIT_ASKPASS_NODE ]]; then
66+# Handle verbose logging
77+if [[ -n $DEBUG ]]; then
88+ set -x
99+fi
1010+1111+if [[ "$VSCODE_GIT_IPC_HANDLE" != "" && "$VSCODE_GIT_ASKPASS_NODE" != "" && "$TERM_PROGRAM" == "vscode" ]]; then
712 __VSCODE_BASE_PATH="$(dirname "${VSCODE_GIT_ASKPASS_NODE}")"
813914 # Check if the path is in ~/.vscode/cli/servers (for Remote Tunnels), ~/.vscode-server/cli
1015 # (for Remote SSH) or not
1111- if [[ $__VSCODE_BASE_PATH =~ ^/home/[^/]+/.vscode/cli/servers ]] || [[ $__VSCODE_BASE_PATH =~ ^/home/[^/]+/.vscode-server/cli ]]; then
1616+ if [[ $__VSCODE_BASE_PATH =~ ^"$HOME"/.vscode/cli/servers ]] || [[ $__VSCODE_BASE_PATH =~ ^"$HOME"/.vscode-server/cli ]]; then
1217 # If it is, set the path to the correct location
1318 VSCODE_CLI_PATH="${__VSCODE_BASE_PATH}/bin/remote-cli/code"
1419 else
1515- # otherwise just use plain cli
2020+ # otherwise just use plain cli/desktop app CLI
1621 VSCODE_CLI_PATH="$(command -v code)"
1722 fi
18231924 export GIT_EDITOR="${VSCODE_CLI_PATH} --wait" EDITOR="${VSCODE_CLI_PATH} --wait" VISUAL="${VSCODE_CLI_PATH} --wait" VSCODE_CLI_PATH
2025fi
2626+2727+if [[ -n $DEBUG ]]; then
2828+ set +x
2929+fi