Fix width of terminal

This commit is contained in:
ernstmul
2025-05-09 15:58:23 +02:00
parent fadf34c97c
commit fdff5b6a0c
2 changed files with 14 additions and 8 deletions
+13 -8
View File
@@ -8,6 +8,7 @@
synapse: Synapse;
};
let { height, synapse }: Props = $props();
let resizeTimeout: ReturnType<typeof setTimeout> | null = null;
const terminal: Action = (node) => {
const init = async () => {
@@ -41,14 +42,18 @@
const { cols, rows } = fitAddon.proposeDimensions();
if (term.cols === cols && term.rows === rows) return;
if (!Number.isInteger(cols) || !Number.isInteger(rows)) return;
term.resize(cols - 3, rows);
synapse.dispatch('terminal', {
operation: 'updateSize',
params: {
rows,
cols: cols - 3
}
});
term.resize(cols - 1, rows);
if (resizeTimeout) clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(() => {
synapse.dispatch('terminal', {
operation: 'updateSize',
params: {
rows,
cols: cols - 1
}
});
}, 200);
});
observer.observe(node);
};
+1
View File
@@ -624,5 +624,6 @@
.editor-wrapper {
flex-grow: 1;
padding-inline: var(--space-4);
width: 0;
}
</style>