termites 1.0.18 → 1.0.19

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 +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termites",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
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
@@ -1236,6 +1236,15 @@ class TermitesServer {
1236
1236
  }
1237
1237
  // Initial adjustment
1238
1238
  handleViewportResize();
1239
+ // Resize when window gains focus (switching from mobile to desktop)
1240
+ window.addEventListener('focus', () => {
1241
+ setTimeout(handleViewportResize, 100);
1242
+ });
1243
+ document.addEventListener('visibilitychange', () => {
1244
+ if (!document.hidden) {
1245
+ setTimeout(handleViewportResize, 100);
1246
+ }
1247
+ });
1239
1248
  connect();
1240
1249
  applyTheme(currentTheme);
1241
1250
  }