Terminal Keep-Alive (with clean input)

粘贴后立即清除字符,防止命令行污染,保持 SSH 会话活跃

当前为 2025-07-30 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
chyxhtc
评分
0 0 0
版本
1.3
创建于
2025-07-30
更新于
2025-07-30
大小
2.0 KB
许可证
MIT
适用于

📌 What it does

This userscript keeps web-based SSH terminals alive by simulating human activity without polluting the command line. It:

  • Pasts an invisible character (zero-width space \u200B)
  • Then immediately pastes an empty string to "erase" it
  • This triggers activity but leaves the terminal clean

Works with canvas-based terminals embedded in <iframe>s, like those built on xterm.js or similar.


✅ Features

  • Zero-pollution: no leftover input
  • Canvas terminal compatible
  • Multi-tab / multi-iframe friendly
  • No focus required
  • Adjustable random intervals (2.8–3.5 mins by default)

🛠️ Customize

If needed, you can change the interval range inside the script:

getRandomInterval(min = 170000, max = 210000)  // milliseconds