Skip to content

Commit

Permalink
html: only show resize overlay on ws
Browse files Browse the repository at this point in the history
  • Loading branch information
tsl0922 committed Sep 3, 2022
1 parent 5b3426a commit 790cfb3
Show file tree
Hide file tree
Showing 2 changed files with 1,297 additions and 1,295 deletions.
9 changes: 5 additions & 4 deletions html/src/components/terminal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,11 @@ export class Xterm extends Component<Props> {
@bind
private onTerminalResize(size: { cols: number; rows: number }) {
const { overlayAddon, socket, textEncoder, resizeOverlay } = this;
if (socket && socket.readyState === WebSocket.OPEN) {
const msg = JSON.stringify({ columns: size.cols, rows: size.rows });
socket.send(textEncoder.encode(Command.RESIZE_TERMINAL + msg));
}
if (!socket || socket.readyState !== WebSocket.OPEN) return;

const msg = JSON.stringify({ columns: size.cols, rows: size.rows });
socket.send(textEncoder.encode(Command.RESIZE_TERMINAL + msg));

if (resizeOverlay) {
setTimeout(() => {
overlayAddon.showOverlay(`${size.cols}x${size.rows}`);
Expand Down
Loading

0 comments on commit 790cfb3

Please sign in to comment.