From 1d1eccc1d219dbd996ea59f5bfda1926c7749ece Mon Sep 17 00:00:00 2001 From: lmoresi Date: Tue, 5 May 2026 07:38:46 +1000 Subject: [PATCH 1/2] uw: add `./uw shell`, warn about bare `pixi shell` after setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bare `pixi shell` ignores .pixi-env and uses the literal 'default' environment in pixi.toml, which is the lightweight conda-forge PETSc env with no nodejs / dev tools. Users who configure a dev env via `./uw setup` (or `./uw set-env dev`) and then type `pixi shell` end up in the wrong env without realising — first-timer trap, also a trap when returning to a machine after a break. A. Add `./uw shell` subcommand: `exec pixi shell -e $(get_env)`. Mirrors the existing pattern of every other `./uw` command and always lands in the env `./uw` thinks you're in. Listed under Setup in --help. B. After "Setup complete!", advertise `./uw shell` in the Usage block and add a one-paragraph Note explaining the bare-pixi-shell trap. No changes to pixi.toml. No behaviour change for anything other than the new `./uw shell` invocation. Underworld development team with AI support from Claude Code (https://claude.com/claude-code) --- uw | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/uw b/uw index b21cad879..0dbf13e37 100755 --- a/uw +++ b/uw @@ -903,6 +903,7 @@ run_setup() { echo "Usage:" echo " ./uw build Build underworld3" echo " ./uw test Run tests" + echo " ./uw shell Open a shell in this env ($new_env)" # Show Jupyter info case "$new_env" in @@ -917,6 +918,10 @@ run_setup() { ;; esac echo "" + echo "Note: a bare 'pixi shell' / 'pixi run' uses pixi's lightweight 'default'" + echo " env, which lacks dev tools (nodejs, claude, linters, docs)." + echo " Use './uw shell' (or 'pixi shell -e $new_env') to activate this env." + echo "" echo "For VS Code / IDE Jupyter kernels, set pixi environment to: $new_env" } @@ -965,6 +970,7 @@ COMMANDS Setup: setup Interactive configuration wizard set-env NAME Change environment directly + shell Open a pixi shell in the configured env (not pixi's 'default') ai-tools Configure external AI instruction paths claude-perms Configure Claude Code permissions (safe defaults) install-claude Install Claude Code CLI into the dev pixi env (run via ./uw claude) @@ -1680,6 +1686,13 @@ case "${1:-}" in ai-tools) configure_ai_tools ;; + shell) + # Activate the env stored in .pixi-env, not pixi's literal 'default'. + # Bare `pixi shell` ignores .pixi-env and falls back to the env named + # 'default' in pixi.toml, which is the lightweight conda-forge PETSc + # env without nodejs / dev tools — a common first-timer trap. + exec $PIXI shell -e "$(get_env)" + ;; claude-perms) configure_claude_permissions "$(get_env)" ;; From 42ccb254008c19905adf286ba6422f3299b47ad8 Mon Sep 17 00:00:00 2001 From: lmoresi Date: Tue, 5 May 2026 08:30:19 +1000 Subject: [PATCH 2/2] uw: fix duplicate shell dispatch and help entry from #168 Address Copilot review on PR #168: - A `shell)` case already existed at uw:1592 (forwarding extra args via shift + "$@") and `shell` was already listed under the Development section of --help. The original commit added a second, simpler `shell)` case lower in the dispatch and a third `shell` line under Setup, both unreachable / confusing duplicates. - Fold the explanatory comment about the bare-`pixi shell` trap into the existing dispatch case. Drop the duplicate dispatch block. - Drop the duplicate Setup help line. Update the existing Development help line to mention the trap so the doc still earns its keep. The setup-wizard tail message (introduced in 1d1eccc) is unchanged and still advertises ./uw shell + warns about the bare-pixi-shell pitfall. Underworld development team with AI support from Claude Code (https://claude.com/claude-code) --- uw | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/uw b/uw index 0dbf13e37..02b34835f 100755 --- a/uw +++ b/uw @@ -970,7 +970,6 @@ COMMANDS Setup: setup Interactive configuration wizard set-env NAME Change environment directly - shell Open a pixi shell in the configured env (not pixi's 'default') ai-tools Configure external AI instruction paths claude-perms Configure Claude Code permissions (safe defaults) install-claude Install Claude Code CLI into the dev pixi env (run via ./uw claude) @@ -999,7 +998,7 @@ COMMANDS ./uw test --help Show all test options Development: - shell Interactive pixi shell + shell Interactive pixi shell in the configured env (avoid bare 'pixi shell') jupyter [args] Run jupyter (add --worktree NAME to open a worktree) format Run black type-check Run mypy @@ -1590,6 +1589,10 @@ case "${1:-}" in echo "Run './uw build' to rebuild underworld3" ;; shell) + # Activate the env stored in .pixi-env, not pixi's literal 'default'. + # Bare `pixi shell` ignores .pixi-env and falls back to the env named + # 'default' in pixi.toml, which is the lightweight conda-forge PETSc + # env without nodejs / dev tools — a common first-timer trap. shift exec $PIXI shell -e "$(get_env)" "$@" ;; @@ -1686,13 +1689,6 @@ case "${1:-}" in ai-tools) configure_ai_tools ;; - shell) - # Activate the env stored in .pixi-env, not pixi's literal 'default'. - # Bare `pixi shell` ignores .pixi-env and falls back to the env named - # 'default' in pixi.toml, which is the lightweight conda-forge PETSc - # env without nodejs / dev tools — a common first-timer trap. - exec $PIXI shell -e "$(get_env)" - ;; claude-perms) configure_claude_permissions "$(get_env)" ;;