@@ -1466,10 +1466,10 @@ index 0000000000000000000000000000000000000000..6ce56bec114a6d8daf5dd3ded945ea78
1466
1466
+ }
1467
1467
diff --git a/src/vs/server/node/channel.ts b/src/vs/server/node/channel.ts
1468
1468
new file mode 100644
1469
- index 0000000000000000000000000000000000000000..cb3a45fda10a6bcbff73275b5734641b3319cc9b
1469
+ index 0000000000000000000000000000000000000000..b65bf283739a2b05c82fe38a038d2a10957c0d40
1470
1470
--- /dev/null
1471
1471
+++ b/src/vs/server/node/channel.ts
1472
- @@ -0,0 +1,828 @@
1472
+ @@ -0,0 +1,848 @@
1473
1473
+ import { field, logger } from '@coder/logger';
1474
1474
+ import { Server } from '@coder/node-browser';
1475
1475
+ import * as os from 'os';
@@ -1893,6 +1893,7 @@ index 0000000000000000000000000000000000000000..cb3a45fda10a6bcbff73275b5734641b
1893
1893
+ private readonly maxReplayData = 10000;
1894
1894
+ private totalReplayData = 0;
1895
1895
+
1896
+ + private detached = false;
1896
1897
+ private buffering = false;
1897
1898
+ private readonly _onEvent = new Emitter<terminal.IRemoteTerminalProcessEvent>({
1898
1899
+ // Don't bind to data until something is listening.
@@ -1906,10 +1907,11 @@ index 0000000000000000000000000000000000000000..cb3a45fda10a6bcbff73275b5734641b
1906
1907
+
1907
1908
+ // Replay stored events.
1908
1909
+ onFirstListenerDidAdd: () => {
1909
- + if (this.replayData.length === 0 ) {
1910
+ + if (! this.detached ) {
1910
1911
+ return;
1911
1912
+ }
1912
1913
+
1914
+ + this.detached = false;
1913
1915
+ logger.debug('Terminal replaying', field('id', this.id));
1914
1916
+ this._onEvent.fire({
1915
1917
+ type: 'replay',
@@ -1922,6 +1924,7 @@ index 0000000000000000000000000000000000000000..cb3a45fda10a6bcbff73275b5734641b
1922
1924
+ },
1923
1925
+
1924
1926
+ onLastListenerRemove: () => {
1927
+ + this.detached = true;
1925
1928
+ logger.debug('Terminal unbound', field('id', this.id));
1926
1929
+ if (!this.persist) { // Used by debug consoles.
1927
1930
+ this.dispose();
0 commit comments