Skip to content

Commit f7824bf

Browse files
committed
fixing non ghostty terminal issue when theme not found and briging backward compatibility
1 parent e397398 commit f7824bf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,10 @@ function validateConfig(config: AutohandConfig, configPath: string): void {
208208
if (config.ui.theme && typeof config.ui.theme !== 'string') {
209209
throw new Error(`ui.theme must be a string in ${configPath}`);
210210
}
211-
if (config.ui.theme && !themeExists(config.ui.theme)) {
212-
throw new Error(`ui.theme '${config.ui.theme}' not found. Use 'dark', 'light', or a custom theme in ~/.autohand/themes/`);
211+
// Theme validation is lenient — unknown themes fall back to dark at init time.
212+
// This avoids crashes when a Ghostty or custom theme was saved but is no longer available.
213+
if (config.ui.theme && typeof config.ui.theme === 'string' && !themeExists(config.ui.theme)) {
214+
console.warn(`Theme '${config.ui.theme}' not found — falling back to default.`);
213215
}
214216
if (config.ui.autoConfirm !== undefined && typeof config.ui.autoConfirm !== 'boolean') {
215217
throw new Error(`ui.autoConfirm must be boolean in ${configPath}`);

0 commit comments

Comments
 (0)