From 7b9dd97689db400f2408ed50b04857d7d73d83e5 Mon Sep 17 00:00:00 2001 From: Agando Date: Tue, 29 Sep 2026 15:56:27 +0200 Subject: newOS4 v4.6.15: reentrant print-capture stack, AI tail -f block, read-only sed in safeRead, security test harness (21 checks) --- modules/core/module-fs.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/core/module-fs.js') diff --git a/modules/core/module-fs.js b/modules/core/module-fs.js index 112302b..d94feb8 100644 --- a/modules/core/module-fs.js +++ b/modules/core/module-fs.js @@ -256,6 +256,10 @@ class FileSystemModule { if (c === null || c === undefined) return this.terminal.print('tail: ' + file + ': No such file', 'error'); this.terminal.print(c.split('\n').slice(-n).join('\n')); if (!follow) return; + // AI tool calls cannot press Ctrl+C — auto-downgrade to a bounded read instead of a live timer + if (this.terminal.security && this.terminal.security._aiToolDepth > 0) { + return this.terminal.print('tail: follow mode (-f) is interactive-only; showing last lines instead (use tail -n ' + Math.max(n, 50) + ' for more)', 'warning'); + } // stop any previous follow before starting a new one if (this.terminal._activeFollow && this.terminal._activeFollow.interval) clearInterval(this.terminal._activeFollow.interval); this.terminal._activeFollow = null; -- cgit v1.2.3