diff --git a/modal/cli/programs/run_jupyter.py b/modal/cli/programs/run_jupyter.py index ad54e3cae..2b7fa00e4 100644 --- a/modal/cli/programs/run_jupyter.py +++ b/modal/cli/programs/run_jupyter.py @@ -65,6 +65,8 @@ def run_jupyter(q: Queue): with forward(8888) as tunnel: url = tunnel.url + "/?token=" + token threading.Thread(target=wait_for_port, args=(url, q)).start() + print("\nJupyter on Modal, opening in browser...") + print(f" -> {url}\n") subprocess.run( [ "jupyter", @@ -89,7 +91,5 @@ def main(): run_jupyter.spawn(q) url = q.get() time.sleep(1) # Give Jupyter a chance to start up - print("\nJupyter on Modal, opening in browser...") - print(f" -> {url}\n") webbrowser.open(url) assert q.get() == "done" diff --git a/modal/cli/programs/vscode.py b/modal/cli/programs/vscode.py index 9d960f6e5..22f02d838 100644 --- a/modal/cli/programs/vscode.py +++ b/modal/cli/programs/vscode.py @@ -89,6 +89,9 @@ def run_vscode(q: Queue): token = secrets.token_urlsafe(13) with forward(8080) as tunnel: url = tunnel.url + print("\nVS Code on Modal, opening in browser...") + print(f" -> {url}") + print(f" -> password: {token}\n") threading.Thread(target=wait_for_port, args=((url, token), q)).start() subprocess.run( ["/code-server.sh", "--bind-addr", "0.0.0.0:8080", "."], @@ -103,8 +106,5 @@ def main(): run_vscode.spawn(q) url, token = q.get() time.sleep(1) # Give VS Code a chance to start up - print("\nVS Code on Modal, opening in browser...") - print(f" -> {url}") - print(f" -> password: {token}\n") webbrowser.open(url) assert q.get() == "done"