Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions experiments/shell/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@
}


def require_fixed_vim(mode):
"""candidate-tui types a Vim command into the real shell, so Vim must be on PATH.

Without this check a missing Vim surfaces as a 33-second scenario timeout whose
only trace is the shell echoing "not recognized as an internal or external
command"; the requirement itself is documented in
docs/research/joint-conpty-baseline.md and is a failure, not a skippable
optional dependency (docs/research/more-capture-ech.md).
"""
if mode == "candidate-tui" and shutil.which("vim") is None:
raise RuntimeError(
"candidate-tui drives Vim inside the shell but no fixed Vim is on PATH; "
"see docs/research/joint-conpty-baseline.md")


def validate(row, mode):
if mode in WORKSPACE_DATA_MODES:
closed = 3 if mode in ("ui-workspace-save", "ui-workspace-restore") else 0 if mode == "ui-workspace-empty" else 1
Expand Down Expand Up @@ -430,6 +445,7 @@ def close(self, record=None):
def execute(exe, mode, out, timeout=40, settings_source=None, *, resources=False):
if mode in ("ui-paste-system", "ui-clipboard-system", "ui-copy-system", "ui-copy-bytes-system", "ui-copy-context-system", "ui-actions-system"):
require_hosted_clipboard(os.environ)
require_fixed_vim(mode)
if resources and mode != "ui-workflow-sessions":
raise ValueError("resource observation is limited to the bounded sessions workflow")
out.mkdir(parents=True, exist_ok=False)
Expand Down
Loading