2022-08-30 23:19:19 +08:00
|
|
|
Preserve process.execArgv
|
|
|
|
|
2022-09-10 01:05:30 +08:00
|
|
|
This ensures flags like `--prof` are passed down to the code-server process so
|
|
|
|
we can profile everything.
|
|
|
|
|
|
|
|
To test this:
|
|
|
|
1. run `./lib/node --prof .`
|
|
|
|
2. in another terminal, run `ps -ejww`
|
|
|
|
|
|
|
|
You should see `--prof` next to every code-server process.
|
2022-08-30 23:19:19 +08:00
|
|
|
|
|
|
|
Index: code-server/lib/vscode/src/vs/server/node/extensionHostConnection.ts
|
|
|
|
===================================================================
|
|
|
|
--- code-server.orig/lib/vscode/src/vs/server/node/extensionHostConnection.ts
|
|
|
|
+++ code-server/lib/vscode/src/vs/server/node/extensionHostConnection.ts
|
|
|
|
@@ -228,7 +228,7 @@ export class ExtensionHostConnection {
|
|
|
|
|
|
|
|
public async start(startParams: IRemoteExtensionHostStartParams): Promise<void> {
|
|
|
|
try {
|
|
|
|
- let execArgv: string[] = [];
|
|
|
|
+ let execArgv: string[] = process.execArgv ? process.execArgv.filter(a => !/^--inspect(-brk)?=/.test(a)) : [];
|
|
|
|
if (startParams.port && !(<any>process).pkg) {
|
|
|
|
execArgv = [`--inspect${startParams.break ? '-brk' : ''}=${startParams.port}`];
|
|
|
|
}
|