St_pages issue when app is running

I have the following bug,

When I have an instance of my streamlit app open, and I go to the terminal and terminate it abnormally (CTRL+C) and I relaunch it, if any page is open in the browser while restarting, then show_pages() fails to rename my pages and hide the ones I want.

In order for it to work, I must close all open windows in the browser, and only then restart the app, in that case, pages get renamed correctly and main page is hidden successfully.

I assumed it would be something related with the current directory and show_pages not finding my pages, but printing the current directory with the os library showed that the directory is the same in both cases. I have also modified the paths of the pages to be as โ€œabsoluteโ€ as possible, with โ€œ/opt/app/src/pages/blabla.pyโ€, but it still fails to rename them. Note that there is no error like โ€œThe pages were not foundโ€, they just dont get renamed and the hide page simply doesnt workโ€ฆ

Can you share a simplified example which demonstrates this issue? Feel free to look at the example apps in the st_pages repo to see how they are set up.