Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ powershell -ExecutionPolicy Bypass -File "${this.powershellScriptPath}" %*
} else {
const copilotShellScript = `#!/bin/sh
unset NODE_OPTIONS
NODE_DIR=$(dirname "${process.execPath}")
if [ -d "$NODE_DIR/ld_libs/core" ]; then
LD_LIBRARY_PATH="$NODE_DIR/ld_libs/core\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
if [ -d "$NODE_DIR/ld_libs/openssl" ]; then
LD_LIBRARY_PATH="$NODE_DIR/ld_libs/openssl:$LD_LIBRARY_PATH"
fi
elif [ -d "$NODE_DIR/ld_libs" ]; then
LD_LIBRARY_PATH="$NODE_DIR/ld_libs\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH
ELECTRON_RUN_AS_NODE=1 "${process.execPath}" "${path.join(storageLocation, COPILOT_CLI_SHIM_JS)}" "$@"`;
await fs.copyFile(path.join(__dirname, COPILOT_CLI_SHIM_JS), path.join(storageLocation, COPILOT_CLI_SHIM_JS));
this.shellScriptPath = path.join(storageLocation, COPILOT_CLI_COMMAND);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,16 @@ export class CopilotDebugCommandContribution extends Disposable implements vscod

const makeShellScript = (remoteCommand: string, dir: string, callbackUri: vscode.Uri) => `#!/bin/sh
unset NODE_OPTIONS
NODE_DIR=$(dirname "${process.execPath}")
if [ -d "$NODE_DIR/ld_libs/core" ]; then
LD_LIBRARY_PATH="$NODE_DIR/ld_libs/core\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
if [ -d "$NODE_DIR/ld_libs/openssl" ]; then
LD_LIBRARY_PATH="$NODE_DIR/ld_libs/openssl:$LD_LIBRARY_PATH"
fi
elif [ -d "$NODE_DIR/ld_libs" ]; then
LD_LIBRARY_PATH="$NODE_DIR/ld_libs\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH
ELECTRON_RUN_AS_NODE=1 "${process.execPath}" "${path.join(dir, DEBUG_COMMAND_JS)}" "${callbackUri}" "${remoteCommand}" "$@"`;

const makeBatScript = (ps1Path: string) => `@echo off
Expand Down
19 changes: 19 additions & 0 deletions code/extensions/git/src/askpass.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
#!/bin/sh
# The following block was generated with AI assistance (Cursor AI)
# and reviewed by the maintainers.
#
# Ensure the bundled node can find its shared libraries (e.g. libnode.so).
# In Che, LD_LIBRARY_PATH may be sanitized in terminal sessions to avoid
# library version conflicts with user containers; restore the paths needed
# for the node binary scoped to this script only.
if [ -n "$VSCODE_GIT_ASKPASS_NODE" ]; then
ASKPASS_NODE_DIR=$(dirname "$VSCODE_GIT_ASKPASS_NODE")
if [ -d "$ASKPASS_NODE_DIR/ld_libs/core" ]; then
LD_LIBRARY_PATH="$ASKPASS_NODE_DIR/ld_libs/core${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
if [ -d "$ASKPASS_NODE_DIR/ld_libs/openssl" ]; then
LD_LIBRARY_PATH="$ASKPASS_NODE_DIR/ld_libs/openssl:$LD_LIBRARY_PATH"
fi
elif [ -d "$ASKPASS_NODE_DIR/ld_libs" ]; then
LD_LIBRARY_PATH="$ASKPASS_NODE_DIR/ld_libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH
fi
VSCODE_GIT_ASKPASS_PIPE=`mktemp`
ELECTRON_RUN_AS_NODE="1" VSCODE_GIT_ASKPASS_PIPE="$VSCODE_GIT_ASKPASS_PIPE" VSCODE_GIT_ASKPASS_TYPE="https" "$VSCODE_GIT_ASKPASS_NODE" "$VSCODE_GIT_ASKPASS_MAIN" $VSCODE_GIT_ASKPASS_EXTRA_ARGS $*
cat $VSCODE_GIT_ASKPASS_PIPE
Expand Down
19 changes: 19 additions & 0 deletions code/extensions/git/src/git-editor.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
#!/bin/sh
# The following block was generated with AI assistance (Cursor AI)
# and reviewed by the maintainers.
#
# Ensure the bundled node can find its shared libraries (e.g. libnode.so).
# In Che, LD_LIBRARY_PATH may be sanitized in terminal sessions to avoid
# library version conflicts with user containers; restore the paths needed
# for the node binary scoped to this script only.
if [ -n "$VSCODE_GIT_EDITOR_NODE" ]; then
EDITOR_NODE_DIR=$(dirname "$VSCODE_GIT_EDITOR_NODE")
if [ -d "$EDITOR_NODE_DIR/ld_libs/core" ]; then
LD_LIBRARY_PATH="$EDITOR_NODE_DIR/ld_libs/core${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
if [ -d "$EDITOR_NODE_DIR/ld_libs/openssl" ]; then
LD_LIBRARY_PATH="$EDITOR_NODE_DIR/ld_libs/openssl:$LD_LIBRARY_PATH"
fi
elif [ -d "$EDITOR_NODE_DIR/ld_libs" ]; then
LD_LIBRARY_PATH="$EDITOR_NODE_DIR/ld_libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH
fi

ELECTRON_RUN_AS_NODE="1" \
"$VSCODE_GIT_EDITOR_NODE" "$VSCODE_GIT_EDITOR_MAIN" $VSCODE_GIT_EDITOR_EXTRA_ARGS "$@"
19 changes: 19 additions & 0 deletions code/extensions/git/src/ssh-askpass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ if [ -f /etc/ssh/passphrase ] && command -v ssh-keygen >/dev/null; then
exit 0
fi
fi
# The following block was generated with AI assistance (Cursor AI)
# and reviewed by the maintainers.
#
# Ensure the bundled node can find its shared libraries (e.g. libnode.so).
# In Che, LD_LIBRARY_PATH may be sanitized in terminal sessions to avoid
# library version conflicts with user containers; restore the paths needed
# for the node binary scoped to this script only.
if [ -n "$VSCODE_GIT_ASKPASS_NODE" ]; then
ASKPASS_NODE_DIR=$(dirname "$VSCODE_GIT_ASKPASS_NODE")
if [ -d "$ASKPASS_NODE_DIR/ld_libs/core" ]; then
LD_LIBRARY_PATH="$ASKPASS_NODE_DIR/ld_libs/core${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
if [ -d "$ASKPASS_NODE_DIR/ld_libs/openssl" ]; then
LD_LIBRARY_PATH="$ASKPASS_NODE_DIR/ld_libs/openssl:$LD_LIBRARY_PATH"
fi
elif [ -d "$ASKPASS_NODE_DIR/ld_libs" ]; then
LD_LIBRARY_PATH="$ASKPASS_NODE_DIR/ld_libs${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
fi
export LD_LIBRARY_PATH
fi
VSCODE_GIT_ASKPASS_PIPE=`mktemp`
ELECTRON_RUN_AS_NODE="1" VSCODE_GIT_ASKPASS_PIPE="$VSCODE_GIT_ASKPASS_PIPE" VSCODE_GIT_ASKPASS_TYPE="ssh" "$VSCODE_GIT_ASKPASS_NODE" "$VSCODE_GIT_ASKPASS_MAIN" $VSCODE_GIT_ASKPASS_EXTRA_ARGS $*
cat $VSCODE_GIT_ASKPASS_PIPE
Expand Down
Loading