Skip to content

Commit 0fdff4f

Browse files
committed
fix(core): verify default terminal is valid for current os
Logic was throwing errors since default terminal was set to ‘terminal’ (MacOS terminal).
1 parent 3985cf6 commit 0fdff4f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

apps/desktop/src/components/profileSettings/GeneralSettings.svelte

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,20 @@
9898
value: option.identifier
9999
}));
100100
101+
// Ensure the default terminal is valid for the current platform
102+
$effect(() => {
103+
const currentTerminal = $userSettings.defaultTerminal;
104+
const isValidForPlatform = terminalOptions.some(
105+
(t) => t.identifier === currentTerminal.identifier
106+
);
107+
if (!isValidForPlatform && terminalOptions.length > 0) {
108+
const firstValidTerminal = terminalOptions[0];
109+
if (firstValidTerminal) {
110+
userSettings.update((s) => ({ ...s, defaultTerminal: firstValidTerminal }));
111+
}
112+
}
113+
});
114+
101115
$effect(() => {
102116
if ($user && !loaded) {
103117
loaded = true;

0 commit comments

Comments
 (0)