termites 1.0.26 → 1.0.28

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +26 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termites",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "description": "Web terminal with server-client architecture for remote shell access",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server.js CHANGED
@@ -590,8 +590,9 @@ class TermitesServer {
590
590
  .header-title .host { color: var(--host-color, #859900); }
591
591
  .header-title .sep { color: var(--sep-color, #657b83); }
592
592
  .no-client { color: #888; font-style: italic; }
593
- #terminal-container { flex: 1; padding: 4px; transition: background 0.3s; overflow: hidden; min-height: 0; position: relative; }
593
+ #terminal-container { flex: 1; padding: 4px; transition: background 0.3s; min-height: 0; position: relative; overflow: auto; -webkit-overflow-scrolling: touch; }
594
594
  .xterm { height: 100%; }
595
+ .xterm-viewport { overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
595
596
  .overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 99; opacity: 0; visibility: hidden; transition: all 0.3s; }
596
597
  .overlay.open { opacity: 1; visibility: visible; }
597
598
  .drawer {
@@ -1181,6 +1182,30 @@ class TermitesServer {
1181
1182
 
1182
1183
  setupDraggable(startMarker, true);
1183
1184
  setupDraggable(endMarker, false);
1185
+
1186
+ // Touch scrolling for terminal
1187
+ let touchScrollY = null;
1188
+ const termEl = document.getElementById('terminal-container');
1189
+ termEl.addEventListener('touchstart', (e) => {
1190
+ if (e.touches.length === 1 && !selMode) {
1191
+ touchScrollY = e.touches[0].clientY;
1192
+ }
1193
+ }, { passive: true });
1194
+
1195
+ termEl.addEventListener('touchmove', (e) => {
1196
+ if (touchScrollY !== null && e.touches.length === 1 && !selMode) {
1197
+ const deltaY = touchScrollY - e.touches[0].clientY;
1198
+ const lines = Math.round(deltaY / 20); // ~20px per line
1199
+ if (lines !== 0) {
1200
+ term.scrollLines(lines);
1201
+ touchScrollY = e.touches[0].clientY;
1202
+ }
1203
+ }
1204
+ }, { passive: true });
1205
+
1206
+ termEl.addEventListener('touchend', () => {
1207
+ touchScrollY = null;
1208
+ }, { passive: true });
1184
1209
  }
1185
1210
 
1186
1211
  function updateClientList() {