fixes #161: disable theme watcher in print mode
The theme file watcher was keeping the Node.js process alive indefinitely even in print mode where hot-reload is unnecessary. This fix adds an enableWatcher parameter to initTheme() and setTheme() functions, and only enables watchers in interactive mode. - Modified initTheme() to accept enableWatcher parameter (default: false) - Modified setTheme() to accept enableWatcher parameter (default: false) - Updated main.ts to only enable watchers in interactive mode - Updated InteractiveMode to enable watchers when changing themes
This commit is contained in:
@@ -1164,7 +1164,7 @@ export class InteractiveMode {
|
||||
const selector = new ThemeSelectorComponent(
|
||||
currentTheme,
|
||||
(themeName) => {
|
||||
const result = setTheme(themeName);
|
||||
const result = setTheme(themeName, true);
|
||||
this.settingsManager.setTheme(themeName);
|
||||
this.ui.invalidate();
|
||||
done();
|
||||
@@ -1179,7 +1179,7 @@ export class InteractiveMode {
|
||||
this.ui.requestRender();
|
||||
},
|
||||
(themeName) => {
|
||||
const result = setTheme(themeName);
|
||||
const result = setTheme(themeName, true);
|
||||
if (result.success) {
|
||||
this.ui.invalidate();
|
||||
this.ui.requestRender();
|
||||
|
||||
Reference in New Issue
Block a user