Prevent hot reload with --dev to open a new browser tab at every save

Maybe there is something weird on my environment but I’m getting a very annoying behaviour when I set the --dev option to my bokeh app. Every time I click save, not only is the code re-run but also a new browser tab is opened and it switches from my IDE to it. I have a tick of pressing cmd+s basically after every line written, so it’s actually so annoying that I have to turn the option off.

I used to develop on a remote server that didn’t have access to my browser so the hot reload was great as I just had to refresh the page when I actually wanted to check the changes. But now in my laptop I just have to turn it off or I end up with 500 tabs of the app. Just turning off the the opening of the browser when running the server would already be better.

Thank you in advance for any pointers on that.

All the Bokeh server --dev mode does is turn on Tornado’s autoreload option, which simply restarts the server as it was started originally, whenever watched files change. “As it was started originally” would include, e.g. --show, if you started the server with --show. AFAIK the solution would be not to use --show together with --dev. [1]

  1. This is speculation, of course. The question would have been greatly improved if the complete Bokeh sever invocation used was included. ↩︎

Speculation was on point. The bokeh server invocation was hidden in a Makefile that i wrote long ago and the --show lingered in.
So yeah. Note to anyone who may be wondering: don’t use --show and --dev together!
Thanks for the timely response!

1 Like