Skip to content

Commit 40e0b83

Browse files
committed
Only replay terminals when detached
1 parent f93f3a5 commit 40e0b83

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ci/dev/vscode.patch

+6-3
Original file line numberDiff line numberDiff line change
@@ -1466,10 +1466,10 @@ index 0000000000000000000000000000000000000000..6ce56bec114a6d8daf5dd3ded945ea78
14661466
+}
14671467
diff --git a/src/vs/server/node/channel.ts b/src/vs/server/node/channel.ts
14681468
new file mode 100644
1469-
index 0000000000000000000000000000000000000000..cb3a45fda10a6bcbff73275b5734641b3319cc9b
1469+
index 0000000000000000000000000000000000000000..b65bf283739a2b05c82fe38a038d2a10957c0d40
14701470
--- /dev/null
14711471
+++ b/src/vs/server/node/channel.ts
1472-
@@ -0,0 +1,828 @@
1472+
@@ -0,0 +1,848 @@
14731473
+import { field, logger } from '@coder/logger';
14741474
+import { Server } from '@coder/node-browser';
14751475
+import * as os from 'os';
@@ -1893,6 +1893,7 @@ index 0000000000000000000000000000000000000000..cb3a45fda10a6bcbff73275b5734641b
18931893
+ private readonly maxReplayData = 10000;
18941894
+ private totalReplayData = 0;
18951895
+
1896+
+ private detached = false;
18961897
+ private buffering = false;
18971898
+ private readonly _onEvent = new Emitter<terminal.IRemoteTerminalProcessEvent>({
18981899
+ // Don't bind to data until something is listening.
@@ -1906,10 +1907,11 @@ index 0000000000000000000000000000000000000000..cb3a45fda10a6bcbff73275b5734641b
19061907
+
19071908
+ // Replay stored events.
19081909
+ onFirstListenerDidAdd: () => {
1909-
+ if (this.replayData.length === 0) {
1910+
+ if (!this.detached) {
19101911
+ return;
19111912
+ }
19121913
+
1914+
+ this.detached = false;
19131915
+ logger.debug('Terminal replaying', field('id', this.id));
19141916
+ this._onEvent.fire({
19151917
+ type: 'replay',
@@ -1922,6 +1924,7 @@ index 0000000000000000000000000000000000000000..cb3a45fda10a6bcbff73275b5734641b
19221924
+ },
19231925
+
19241926
+ onLastListenerRemove: () => {
1927+
+ this.detached = true;
19251928
+ logger.debug('Terminal unbound', field('id', this.id));
19261929
+ if (!this.persist) { // Used by debug consoles.
19271930
+ this.dispose();

0 commit comments

Comments
 (0)