Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/patches/cli-window-open.diff
Joe Previte efce00582b
chore: update Code to 1.72.2 (#5650)
* chore: update Code to 1.72.2

* chore: refresh integration patch

* chore: refresh base-path

* chore: refresh proposed-api patch

* chore: refresh marketplace patch

* chore: refresh webview patch

* chore: refresh disable-builtin patch

* chore: refresh logout, update-check patches

* chor: refresh proxy-uri patch

* fix: delete unique-db patch

This was supposed to be removed in https://github.com/coder/code-server/pull/5519

Looks like I didn't update the series or actually delete the patch.

* fix: drop log-level patch

This was merged upstream!

* chore: refresh local-storage patch

* chore: refresh service-worker patch

* chore: refresh sourcemaps patch

* chore: refresh disable-downloads patch

* chore: refresh telemetry patch

* chore: refresh language patch

* chore: refresh cli-window-open patch

* Revert "fix: delete unique-db patch"

This reverts commit ca0506c5f6.

* fixup!: rm extra spaces integration patch

* fixup: space

* fixup! update unique-db patch

* fixup!: update hash in webview patch

* fixup! update marketplace patch

* fixup!: remove comma
2022-10-17 16:30:39 -07:00

35 lines
1.3 KiB
Diff

Make opening files/folders from the terminal only open in the current instance
Previously they would open in every code-server tab/window.
To test:
1. Run code-server
2. Open code-server
3. Open terminal
4. Open another code-server window
5. Run code-server with a file or directory argument
The file or directory should only open from the instance attached to that
terminal.
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
@@ -100,10 +100,14 @@ class RemoteTerminalBackend extends Base
}
const reqId = e.reqId;
const commandId = e.commandId;
+ const terminalId = e.persistentProcessId;
if (!allowedCommands.includes(commandId)) {
this._remoteTerminalChannel.sendCommandResult(reqId, true, 'Invalid remote cli command: ' + commandId);
return;
}
+ if (typeof terminalId !== "undefined" && !this._ptys.has(terminalId)) {
+ return
+ }
const commandArgs = e.commandArgs.map(arg => revive(arg));
try {
const result = await this._commandService.executeCommand(e.commandId, ...commandArgs);