|
7 | 7 | import { SETTINGS_SERVICE } from '$lib/config/appSettingsV2';
|
8 | 8 | import { showError } from '$lib/notifications/toasts';
|
9 | 9 | import { PROJECTS_SERVICE } from '$lib/project/projectsService';
|
10 |
| - import { SETTINGS, type CodeEditorSettings } from '$lib/settings/userSettings'; |
| 10 | + import { |
| 11 | + SETTINGS, |
| 12 | + type CodeEditorSettings, |
| 13 | + type TerminalSettings |
| 14 | + } from '$lib/settings/userSettings'; |
11 | 15 | import { UPDATER_SERVICE } from '$lib/updater/updater';
|
12 | 16 | import { USER_SERVICE } from '$lib/user/userService';
|
13 | 17 |
|
|
58 | 62 | label: option.displayName,
|
59 | 63 | value: option.schemeIdentifer
|
60 | 64 | }));
|
| 65 | + const terminalOptions: TerminalSettings[] = [ |
| 66 | + { appName: 'Terminal.app', displayName: 'Terminal' }, |
| 67 | + { appName: 'Ghostty.app', displayName: 'Ghostty' }, |
| 68 | + { appName: 'Warp.app', displayName: 'Warp' }, |
| 69 | + { appName: 'iTerm.app', displayName: 'iTerm 2' }, |
| 70 | + { appName: 'Alacritty.app', displayName: 'Alacritty' }, |
| 71 | + { appName: 'WezTerm.app', displayName: 'WezTerm' }, |
| 72 | + { appName: 'Hyper.app', displayName: 'Hyper' } |
| 73 | + ]; |
| 74 | + const terminalOptionsForSelect = terminalOptions.map((option) => ({ |
| 75 | + label: option.displayName, |
| 76 | + value: option.appName |
| 77 | + })); |
61 | 78 |
|
62 | 79 | $effect(() => {
|
63 | 80 | if ($user && !loaded) {
|
|
201 | 218 | {/snippet}
|
202 | 219 | </SectionCard>
|
203 | 220 |
|
| 221 | +<SectionCard orientation="row" centerAlign> |
| 222 | + {#snippet title()} |
| 223 | + Default terminal |
| 224 | + {/snippet} |
| 225 | + {#snippet actions()} |
| 226 | + <Select |
| 227 | + value={$userSettings.defaultTerminal.appName} |
| 228 | + options={terminalOptionsForSelect} |
| 229 | + onselect={(value) => { |
| 230 | + const selected = terminalOptions.find((option) => option.appName === value); |
| 231 | + if (selected) { |
| 232 | + userSettings.update((s) => ({ ...s, defaultTerminal: selected })); |
| 233 | + } |
| 234 | + }} |
| 235 | + > |
| 236 | + {#snippet itemSnippet({ item, highlighted })} |
| 237 | + <SelectItem selected={item.value === $userSettings.defaultTerminal.appName} {highlighted}> |
| 238 | + {item.label} |
| 239 | + </SelectItem> |
| 240 | + {/snippet} |
| 241 | + </Select> |
| 242 | + {/snippet} |
| 243 | +</SectionCard> |
| 244 | + |
204 | 245 | <SectionCard labelFor="disable-auto-checks" orientation="row">
|
205 | 246 | {#snippet title()}
|
206 | 247 | Automatically check for updates
|
|
0 commit comments