Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/Terminal/terminal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default function ContainerTerminal(props) {
}

function onTerminalResize() {
window.addEventListener('resize', onResize());
window.addEventListener('resize', resizeHandler);
term.on('resize', resizeRemoteTerminal);
}

Expand All @@ -105,7 +105,8 @@ export default function ContainerTerminal(props) {
}

function removeResizeListener() {
window.removeEventListener('resize', onResize());
window.removeEventListener('resize', resizeHandler);
resizeHandler.cancel();
}

function disconnect() {
Expand All @@ -118,7 +119,7 @@ export default function ContainerTerminal(props) {
}
}

const onResize = () => debounce(() => term.fit(), 800);
const resizeHandler = debounce(() => term.fit(), 800);

const packStdin = (data) =>
JSON.stringify({
Expand Down
7 changes: 0 additions & 7 deletions src/components/Terminal/xterm.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,16 @@
left: 0;
top: 0;
bottom: 0;
max-width: 100%;
}

.xterm .xterm-screen {
position: relative;
max-width: 100%;
}

.xterm .xterm-screen canvas {
position: absolute;
left: 0;
top: 0;
max-width: 100%;
box-sizing: border-box;
}

Expand Down Expand Up @@ -145,7 +142,3 @@
.xterm-cursor-pointer {
cursor: pointer;
}

.xterm-text-layer {
transform: translateY(3px);
}
Loading