diff --git a/panel/config.py b/panel/config.py index 23d2831f56..57ee886ad4 100644 --- a/panel/config.py +++ b/panel/config.py @@ -475,6 +475,20 @@ def __call__(self, *args, **params): load_notebook(config.inline) panel_extension._loaded = True + if 'comms' in params: + return + + # Try to detect environment so that we can enable comms + try: + import google.colab # noqa + config.comms = "colab" + return + except ImportError: + pass + + # Check if we're running in VSCode + if "VSCODE_PID" in os.environ: + config.comms = "vscode" def _apply_signatures(self): from inspect import Parameter, Signature