@dotrino/terminal-agent 0.12.0 → 0.13.0
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.
- package/consoles.js +4 -0
- package/index.js +4 -2
- package/package.json +1 -1
package/consoles.js
CHANGED
|
@@ -62,9 +62,13 @@ class Console {
|
|
|
62
62
|
|
|
63
63
|
resize (cols, rows) {
|
|
64
64
|
if (!cols || !rows) return
|
|
65
|
+
const changed = cols !== this.cols || rows !== this.rows
|
|
65
66
|
this.cols = cols; this.rows = rows
|
|
66
67
|
try { this.pty.resize(cols, rows) } catch (_) {}
|
|
67
68
|
try { this.screen.resize(cols, rows) } catch (_) {}
|
|
69
|
+
// Quien mira desde otro aparato se entera del tamaño nuevo y adapta su vista (la PWA no
|
|
70
|
+
// encoge la consola: la muestra a su tamaño, con desplazamiento).
|
|
71
|
+
if (changed) this._meta()
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
/**
|
package/index.js
CHANGED
|
@@ -70,7 +70,9 @@ export function makeHub (pty, opts = {}) {
|
|
|
70
70
|
* ella: cerrar la ventana mata su shell, como en cualquier terminal. Una ventana que solo
|
|
71
71
|
* se enganchó a una consola ajena, o que la soltó a propósito (`detach`), no mata nada.
|
|
72
72
|
*
|
|
73
|
-
* Tamaño con varios mirando: manda el último que se enganchó o
|
|
73
|
+
* Tamaño con varios mirando: manda el último que se enganchó (o abrió). Escribir lo cambia solo
|
|
74
|
+
* desde una ventana de esta máquina; desde otro aparato (la PWA), solo al engancharse o con su
|
|
75
|
+
* botón «Ajustar a esta pantalla» (un `resize` explícito).
|
|
74
76
|
* Exportada para las pruebas.
|
|
75
77
|
*
|
|
76
78
|
* @param {object} session
|
|
@@ -131,7 +133,7 @@ export function serveSession (session, hub, { origin = 'remote' } = {}) {
|
|
|
131
133
|
if (msg.type === 'detach') { owned = null; release(); return }
|
|
132
134
|
if (msg.type === 'input') {
|
|
133
135
|
if (!current) return
|
|
134
|
-
if (current.cols !== size.cols || current.rows !== size.rows) current.resize(size.cols, size.rows)
|
|
136
|
+
if (origin === 'local' && (current.cols !== size.cols || current.rows !== size.rows)) current.resize(size.cols, size.rows)
|
|
135
137
|
current.write(String(msg.data ?? ''))
|
|
136
138
|
return
|
|
137
139
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/terminal-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Dotrino Terminal: las ventanas de esta máquina (dotrino-terminal) y su agente, que deja abrir esas mismas consolas desde los otros aparatos de tu cuenta, cifrado punto a punto.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|