Skip to content

fix(devtools): stop DevTools server on flutter shutdown#521

Merged
sidlatau merged 1 commit into
nvim-flutter:mainfrom
josephemorgan:main
Apr 23, 2026
Merged

fix(devtools): stop DevTools server on flutter shutdown#521
sidlatau merged 1 commit into
nvim-flutter:mainfrom
josephemorgan:main

Conversation

@josephemorgan
Copy link
Copy Markdown
Contributor

on_flutter_shutdown() only cleared profiler_url and devtools_profiler_url but left devtools_url, devtools_pid, and the DevTools server process alive. After quit and relaunch in debug mode, the stale devtools_url caused the browser to open with the old port instead of the new one.

Call M.stop() in on_flutter_shutdown() to kill the DevTools process and clear all state so the next launch starts fresh.

fixes #520 (comment)

on_flutter_shutdown() only cleared profiler_url and
devtools_profiler_url but left devtools_url, devtools_pid, and the
DevTools server process alive. After quit and relaunch in debug mode,
the stale devtools_url caused the browser to open with the old port
instead of the new one.

Call M.stop() in on_flutter_shutdown() to kill the DevTools process
and clear all state so the next launch starts fresh.
@kolchurinvv
Copy link
Copy Markdown

if this really all it takes to fix this, could we please merge this in? i've been having this annoyance for a while. would be a nice DX improvement

@sidlatau sidlatau merged commit 1f532b5 into nvim-flutter:main Apr 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] DevTools opens browser with stale port after quit and relaunch in debug mode

3 participants