From de7adf784b9b255f287cbcee4d65bc389ab5ecaa Mon Sep 17 00:00:00 2001 From: takotaketakoi Date: Fri, 23 Aug 2024 00:52:50 +0900 Subject: [PATCH] add environment variable check when register webbrowser --- onlinejudge_command/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/onlinejudge_command/utils.py b/onlinejudge_command/utils.py index 6bc21685..200b153a 100644 --- a/onlinejudge_command/utils.py +++ b/onlinejudge_command/utils.py @@ -189,6 +189,8 @@ def webbrowser_register_explorer_exe() -> None: if not is_windows_subsystem_for_linux(): return + if os.getenv('REMOTE_CONTAINERS', '').lower() == "true": + return instance = webbrowser.GenericBrowser('explorer.exe') webbrowser.register('explorer', None, instance, preferred=True) # `preferred=True` solves the issue that terminal logs are cleared on cmd.exe with stopping using wslview via www-browser. TODO: remove `preferred=True` after https://github.com/wslutilities/wslu/issues/199 is fixed.