#!/usr/bin/env bash
set -u
# Run from a current-main worktree with the uploaded scenarios in scripts/scenarios.
base=8753e4d36bfdc33f0df9046ea239ad8f361b8ff1
head=e8f6b028cb97fd561549cb70d8cb0469f6d87ed9
probe_dir=$(mktemp -d)
mkdir "$probe_dir/shell tools"
ln -s /bin/dash "$probe_dir/shell tools/sh"
export T3CODE_DEV_SEED=0 SHELL=/bin/bash PS1='> ' PROMPT_COMMAND="PS1='> '"
export T3CODE_TERMINAL_SHELL="$probe_dir/shell tools/sh"
export T3_SCENARIO_INHERIT_ENV=SHELL,T3CODE_TERMINAL_SHELL,T3CODE_DEV_SEED,PROMPT_COMMAND,PS1
vp run scenarios:prove scripts/scenarios/interactive-shell-override.e2e.ts --base "$base" --head "$head"
# Preserve each scripts/.e2e/prove directory before the next command overwrites it.
vp run scenarios:prove scripts/scenarios/interactive-shell-regressions.e2e.ts --base "$base" --head "$head"
unset T3CODE_TERMINAL_SHELL
export PROBE_LABEL=restored-default-shell PROBE_EXPECTED=/usr/bin/bash
export T3_SCENARIO_INHERIT_ENV=SHELL,T3CODE_DEV_SEED,PROMPT_COMMAND,PS1,PROBE_LABEL,PROBE_EXPECTED
# This supplemental regression should pass on BOTH commits (runner exit 1).
vp run scenarios:prove scripts/scenarios/interactive-shell-default.e2e.ts --base "$base" --head "$head"
