Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: check isatty for sandboxing (#2826)

Myles Scolnicka7144c07733f
diff --git a/marimo/_cli/run_docker.py b/marimo/_cli/run_docker.py
index e5d91d97ca..db7d44faa3 100644
--- a/marimo/_cli/run_docker.py
+++ b/marimo/_cli/run_docker.py
@@ -31,6 +31,11 @@ def prompt_run_in_docker_container(name: str | None) -> bool:
if GLOBAL_SETTINGS.YES:
return True
+ # Check if not in an interactive terminal
+ # default to False
+ if not sys.stdin.isatty():
+ return False
+
return click.confirm(
"This notebook is hosted on a remote server.\n"
+ green(
diff --git a/marimo/_cli/sandbox.py b/marimo/_cli/sandbox.py
index f28ae27ca9..5aced145de 100644
--- a/marimo/_cli/sandbox.py
+++ b/marimo/_cli/sandbox.py
@@ -156,6 +156,11 @@ def prompt_run_in_sandbox(name: str | None) -> bool:
if GLOBAL_SETTINGS.YES:
return True
+ # Check if not in an interactive terminal (i.e. Docker)
+ # default to False
+ if not sys.stdin.isatty():
+ return False
+
return click.confirm(
"This notebook has inlined package dependencies.\n"
+ green(