Terminal Keep-Alive (with clean input)

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

目前為 2025-07-30 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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