From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH] fix #6223: fit terminal after 'OK' message
Date: Tue, 18 Mar 2025 10:09:00 +0100 [thread overview]
Message-ID: <20250318090900.725706-1-d.csapak@proxmox.com> (raw)
instead of simply waiting 250ms after we send the credentials, wait
until after the server responded with 'OK' to fit the terminal size.
Still keep the timeout to not do that in the onmessage handler itself,
but rather at a later point in time.
This fixes an issue with not properly fitted area, when it takes longer
than 250ms to establish the connection and the first fit would be before
we could send the client size to the server.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
xterm.js/src/main.js | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/xterm.js/src/main.js b/xterm.js/src/main.js
index 289032c..b4b5c43 100644
--- a/xterm.js/src/main.js
+++ b/xterm.js/src/main.js
@@ -222,6 +222,12 @@ function runTerminal() {
if (answer[0] === 79 && answer[1] === 75) { // "OK"
updateState(states.connected);
term.write(answer.slice(2));
+
+ // initial focus and resize
+ setTimeout(function() {
+ term.focus();
+ fitAddon.fit();
+ }, 250);
} else {
socket.close();
}
@@ -247,12 +253,6 @@ function runTerminal() {
});
socket.send(PVE.UserName + ':' + ticket + "\n");
-
- // initial focus and resize
- setTimeout(function() {
- term.focus();
- fitAddon.fit();
- }, 250);
}
function getLxcStatus(callback) {
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next reply other threads:[~2025-03-18 9:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-18 9:09 Dominik Csapak [this message]
2025-03-25 18:44 ` Thomas Lamprecht
2025-03-26 8:11 ` Dominik Csapak
2025-03-26 10:19 ` Thomas Lamprecht
2025-03-26 10:42 ` Dominik Csapak
2025-04-04 16:54 ` Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250318090900.725706-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal