mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 14:45:24 +00:00
fix(session-sharing): synchronize shared SSH terminal dimensions (#1502)
This commit is contained in:
1 parent
c265758cdd
commit
0f6e48a95c
7 files changed
+341
-15
No files matched your search
@@ -444,6 +444,15 @@ export class TerminalSessionManager {
|
||||
tabInstanceId: opts.tabInstanceId,
|
||||
joinedViaShareId: opts.shareId,
|
||||
});
|
||||
if (ws.readyState === WebSocket.OPEN) {
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
type: "resized",
|
||||
cols: session.cols,
|
||||
rows: session.rows,
|
||||
}),
|
||||
);
|
||||
}
|
||||
this.broadcastParticipants(sessionId);
|
||||
|
||||
this.log.info("Participant joined shared session", {
|
||||
@@ -812,6 +821,15 @@ export class TerminalSessionManager {
|
||||
this.recordSessionEvent(session, "i", data);
|
||||
}
|
||||
|
||||
resizeSession(sessionId: string, cols: number, rows: number): void {
|
||||
const session = this.sessions.get(sessionId);
|
||||
if (!session) return;
|
||||
session.cols = cols;
|
||||
session.rows = rows;
|
||||
this.broadcast(sessionId, { type: "resized", cols, rows });
|
||||
this.bufferResize(sessionId, cols, rows);
|
||||
}
|
||||
|
||||
bufferResize(sessionId: string, cols: number, rows: number): void {
|
||||
const session = this.sessions.get(sessionId);
|
||||
if (!session) return;
|
||||
|
||||
Reference in new issue
Block a user