aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-fs.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules/core/module-fs.js')
-rw-r--r--modules/core/module-fs.js4
1 files changed, 4 insertions, 0 deletions
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;