This issue does not seem to be resolved and I am perplexed if this is intended behavior or an issue that has not been fixed. Basically if you have a streamlit app running and close the browser, trying to stop the app with ctrl+c does not work.
Steps to reproduce
close browser app when streamlit is running
ctrl+c in the terminal
app does not stop running
open the app from the URL link so it opens in the browser again
ctrl+c in the terminal
app stops running (yay!)
Expected behavior:
Launch streamlit from the terminal
Close browser
ctrl+c in the terminal
app stops running (yay!)
Actual behavior:
Launch streamlit from the terminal
Close browser
ctrl+c in the terminal
app does not stop running (boo!)
Debug info
Streamlit version: 1.19.0
Python version: 3.9.12
Using venv
OS version: Microsoft Windows 11 Home 10.0.22621 Build 22621
Browser version: Chrome Version 110.0.5481.178 (Official Build) (64-bit)
I can confirm this behavior. When I close the browser tab, the terminal no longer responds to Ctrl+C, I have to kill the process or close the terminal session.
However, if I remember correctly, this behavior only occurs under Windows.
These are my boundary conditions: Windows 10, Firefox, cmder terminal, Streamlit 1.19.0
I have not tried other browsers or other terminals.
I can also confirm. windows 11. finally I had multiple situations the app closing immediately starts if you CTR+click again on the localhost link to start the app again after closing the browser. So at least there is a workaround vs waiting atm.
Same behaviour here on Windows 10 using Microsoft Edge and Windows command line in PyCharm. Indeed, the workaround is to reopen the link to the Streamlit app and the terminal will be able to kill the process successfully.
I can also confirm this under Windows 10. I always thought this behaviour was intended (even though annoying). In short: When no tab is connected to the streamlit server, you cannot terminate the streamlit server by pressing CTRL+C in the terminal. You have to open a new tab first. Only then CTRL+C will actually go through.
This continually happens to me on Mac and Chrome. Ctrl+C works for awhile. and then stops receiving input and hangs. This is something like 6-10 runs when it happens.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.