diff --git a/CHANGELOG.md b/CHANGELOG.md index 8876d8e8..3cd5ef79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # gdbgui release history +- start browser in a new thread to avoid connection errors + ## 0.15.3.0 - Update default python version to 3.13 diff --git a/gdbgui/server/server.py b/gdbgui/server/server.py index a638d9fd..db043e63 100644 --- a/gdbgui/server/server.py +++ b/gdbgui/server/server.py @@ -1,5 +1,6 @@ import os import socket +import threading import webbrowser from .constants import DEFAULT_HOST, DEFAULT_PORT, colorize @@ -82,7 +83,12 @@ def run_server( text = ("Opening gdbgui with %s at " + protocol + "%s:%d") % args print(colorize(text)) b = webbrowser.get(browsername) if browsername else webbrowser - b.open(url_with_prefix) + + # open the dashboard directly in a new tab/window in a new thread + def open_browser_func(): + b.open_new_tab(url_with_prefix) + + threading.Thread(target=open_browser_func).start() else: print(colorize(f"View gdbgui at {protocol}{url[0]}:{url[1]}")) print(