Problem
Clicking the Switchboard icon while the app is already running spawns a second instance instead of focusing the existing window.
There are two issues with this:
- No real use case — Switchboard is a session manager; having two copies of it open at the same time doesn't give you anything a single window doesn't (sessions, search, terminal, etc. are all the same data).
- Performance — each instance is a full Electron process (+ renderer + workers + pty + watchers). Running two in parallel makes the machine noticeably laggy, especially on laptops or lower-end boxes.
Expected behavior
Re-launching Switchboard (clicking the dock/taskbar icon, switchboard from a terminal, etc.) should focus and raise the already-running window instead of spawning a new process.
This is the default pattern for most Electron apps (VS Code, Slack, Discord, Obsidian…) and is what users instinctively expect.
Suggested implementation
Electron ships this out of the box — a few lines in main.js:
const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) {
app.quit();
} else {
app.on('second-instance', () => {
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore();
mainWindow.focus();
}
});
}
Docs: https://www.electronjs.org/docs/latest/api/app#apprequestsingleinstancelock
Optional
If some users genuinely want multiple instances (multi-monitor workflows?), it could be guarded behind a setting like allowMultipleInstances: false (default) in preferences. But honestly, single-instance-by-default with no option would already cover 99% of cases.
Thanks for the app! 🙏
Problem
Clicking the Switchboard icon while the app is already running spawns a second instance instead of focusing the existing window.
There are two issues with this:
Expected behavior
Re-launching Switchboard (clicking the dock/taskbar icon,
switchboardfrom a terminal, etc.) should focus and raise the already-running window instead of spawning a new process.This is the default pattern for most Electron apps (VS Code, Slack, Discord, Obsidian…) and is what users instinctively expect.
Suggested implementation
Electron ships this out of the box — a few lines in
main.js:Docs: https://www.electronjs.org/docs/latest/api/app#apprequestsingleinstancelock
Optional
If some users genuinely want multiple instances (multi-monitor workflows?), it could be guarded behind a setting like
allowMultipleInstances: false(default) in preferences. But honestly, single-instance-by-default with no option would already cover 99% of cases.Thanks for the app! 🙏