Skip to content

Commit a64482e

Browse files
fix(core): prevent duplicate app restarts when typing 'rs' multiple times (#4089)
When typing 'rs' multiple times before the app restarts, each 'rs' command attached a new 'exit' listener. This caused multiple apps to launch when the process finally exited. Adding a check for lastSpawned.restarted ensures subsequent 'rs' commands are ignored until the restart completes. Co-authored-by: Claude <[email protected]>
1 parent df3127c commit a64482e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/api/core/src/api/start.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ export default autoTrace(
287287

288288
if (interactive) {
289289
process.stdin.on('data', (data) => {
290-
if (data.toString().trim() === 'rs' && lastSpawned) {
290+
if (data.toString().trim() === 'rs' && lastSpawned && !lastSpawned.restarted) {
291291
readline.moveCursor(process.stdout, 0, -1);
292292
readline.clearLine(process.stdout, 0);
293293
readline.cursorTo(process.stdout, 0);

0 commit comments

Comments
 (0)