I agree… on Windows I do it this way and have several of them in my launch.json because I want a selection of server ports (Why? Because I have a personal gists project with dozens of Streamlit apps all on the go… if you know of a way to randomize that port number, please let me know?)
{
"name": "Streamlit 4321",
"type": "debugpy",
"request": "launch",
"module": "streamlit",
"args": ["run", "--server.port", "4321", "${file}"],
"justMyCode": true,
"redirectOutput": true,
"logToFile": true,
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
]
},