myrlin-workbook 0.8.6 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/web/pty-manager.js +10 -7
- package/src/web/public/terminal.js +7 -3
package/package.json
CHANGED
package/src/web/pty-manager.js
CHANGED
|
@@ -373,14 +373,17 @@ class PtySessionManager {
|
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
-
// Throttled lastActive update -
|
|
376
|
+
// Throttled lastActive update - deferred via setImmediate to avoid
|
|
377
|
+
// blocking the PTY data path with synchronous JSON file I/O.
|
|
377
378
|
if (!session._lastActiveTimer) {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
store.
|
|
382
|
-
|
|
383
|
-
|
|
379
|
+
setImmediate(() => {
|
|
380
|
+
try {
|
|
381
|
+
const store = getStore();
|
|
382
|
+
if (store.getSession(sessionId)) {
|
|
383
|
+
store.updateSession(sessionId, {});
|
|
384
|
+
}
|
|
385
|
+
} catch (_) {}
|
|
386
|
+
});
|
|
384
387
|
session._lastActiveTimer = setTimeout(() => {
|
|
385
388
|
session._lastActiveTimer = null;
|
|
386
389
|
}, 30000);
|
|
@@ -1009,14 +1009,18 @@ class TerminalPane {
|
|
|
1009
1009
|
// Track completion (debounced internally)
|
|
1010
1010
|
this._trackActivityForCompletion();
|
|
1011
1011
|
|
|
1012
|
-
// Debounce activity detection to at most once per 200ms
|
|
1012
|
+
// Debounce activity detection to at most once per 200ms.
|
|
1013
|
+
// Skip for unfocused terminals to avoid wasting CPU on regex
|
|
1014
|
+
// parsing when the result won't be visible anyway.
|
|
1013
1015
|
if (!this._activityDebounceTimer) {
|
|
1014
1016
|
this._activityDebounceTimer = setTimeout(() => {
|
|
1015
1017
|
this._activityDebounceTimer = null;
|
|
1016
1018
|
const sample = this._activitySample;
|
|
1017
1019
|
this._activitySample = '';
|
|
1018
|
-
if (sample
|
|
1019
|
-
|
|
1020
|
+
if (sample && this._isFocused) {
|
|
1021
|
+
this._detectActivity(sample);
|
|
1022
|
+
this._analyzeForAutoTrust(sample);
|
|
1023
|
+
}
|
|
1020
1024
|
}, 200);
|
|
1021
1025
|
}
|
|
1022
1026
|
}
|