mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Fix width of terminal
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
@@ -624,5 +624,6 @@
|
||||
.editor-wrapper {
|
||||
flex-grow: 1;
|
||||
padding-inline: var(--space-4);
|
||||
width: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user