@dotrino/terminal-agent 0.24.0 → 0.24.1
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/bin/terminal.js +15 -5
- package/package.json +1 -1
package/bin/terminal.js
CHANGED
|
@@ -435,13 +435,23 @@ function interactive (conn, first, dir) {
|
|
|
435
435
|
if (m.type === 'meta') { onInfo(m.console); return }
|
|
436
436
|
if (m.type === 'exit') {
|
|
437
437
|
// LA CERRÓ OTRA PANTALLA (el teléfono, la web, el panel de otra ventana): esta ventana no
|
|
438
|
-
// se va — nadie aquí pidió cerrarla, y cerrarla dejaba al usuario sin ventana
|
|
439
|
-
//
|
|
440
|
-
//
|
|
438
|
+
// se va — nadie aquí pidió cerrarla, y cerrarla dejaba al usuario sin ventana. Pasa a una
|
|
439
|
+
// consola que YA existe: primero una que no mire nadie; si todas se miran, la primera igual.
|
|
440
|
+
// Una NUEVA solo si la máquina se quedó sin ninguna (dueño, 2026-10-07: la misma regla que
|
|
441
|
+
// el panel de la web y de los teléfonos), y entonces se dice. Si la shell terminó sola
|
|
442
|
+
// (`exit`) o la cerró esta misma ventana, la ventana se cierra, como cualquier terminal.
|
|
441
443
|
if (m.closedBy === 'other') {
|
|
444
|
+
const closed = consoleId
|
|
442
445
|
consoleId = null
|
|
443
|
-
|
|
444
|
-
|
|
446
|
+
ready = false // lo que se teclee mientras tanto espera a la consola que venga
|
|
447
|
+
request(conn, { type: 'list' }, 'consoles').then((r) => {
|
|
448
|
+
if (r.type !== 'consoles') return // un `fail`: ya lo atendió el manejador de abajo
|
|
449
|
+
const rest = r.list.filter((c) => c.id !== closed)
|
|
450
|
+
const other = rest.find((c) => !c.watchers.length) || rest[0]
|
|
451
|
+
if (other) return switchTo({ type: 'attach', id: other.id })
|
|
452
|
+
switchTo({ type: 'open', cwd: first.cwd || path.resolve(process.cwd()) })
|
|
453
|
+
out.write(`\x1b[2m${t('Otra pantalla cerró esta consola. Esta es una nueva.', 'Another screen closed this console. This is a new one.')}\x1b[0m\r\n`)
|
|
454
|
+
})
|
|
445
455
|
return
|
|
446
456
|
}
|
|
447
457
|
finish(m.code || 0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotrino/terminal-agent",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.1",
|
|
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": {
|