Fix: terminal focus-on-open and exit message

This commit is contained in:
Quinten Kock 2025-11-29 17:37:14 +01:00
parent d020f41b89
commit 5ac4d3d7cf
2 changed files with 5 additions and 1 deletions

View File

@ -54,6 +54,9 @@ export function addTerminal() {
const term = new Terminal();
editors[currentTab.val].push(vanX.noreactive(term));
term.focus();
setTimeout(() => {
term.focus();
}, 0);
}
const TabHeader = (tab: State<Editor[]>, del: () => void, k: number) =>

View File

@ -61,7 +61,7 @@ export class Terminal implements Displayable {
this.terminalId,
(exitCode) => {
this.term.writeln(
`\r\n[Process exited with code ${exitCode}]\n"Press any key to close..."`,
`\r\n[Process exited with code ${exitCode}]\r\nPress any key to close...`,
);
this.term.onData(() => this.close());
@ -108,6 +108,7 @@ export class Terminal implements Displayable {
}
focus() {
this.dom.scrollIntoView();
this.term.focus();
}