Skip to content

fix(shell): stop sourced shell files from enabling errexit - #14

Merged
Dreamcoder08 merged 4 commits into
mainfrom
pr/04-shell-safety
Sep 29, 2026
Merged

Dreamcoder08 merged 4 commits into
mainfrom
pr/04-shell-safety

Conversation

@Dreamcoder08

@Dreamcoder08 Dreamcoder08 commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Snippets sourced by .zshrc/.bashrc started with set -euo pipefail, so the first failing command closed an interactive terminal.

Changes

  • LS_COLORS, fzf and bat snippet generators no longer emit shell options (regenerated variants included)
  • .zshrc drops errexit/nounset and resolves the mode like fish
  • dreamcoder-icons.sh no longer enables errexit; a bats test sources every shell lib and asserts no option changed

Verification

tests/test_sourced_snippets_shell_options.py and tests/shell/test_sourced_shell_lib.bats (RED before, GREEN after); zsh survives false after startup.

Chain Context

Field Value
Chain ML4W 2.16 + Herdr 0.9.1 + Light/Dark-only stabilisation
Tracker PR Not needed (stacked PRs to main)
Position 4 of 6
Base pr/03-theme-mode-and-listener
Depends on #13
Follow-up #15
Review budget 80 / 400
Starts at the tip of pr/03-theme-mode-and-listener
Ends with fix(shell): stop sourced shell files from enabling errexit

Chain Overview

main
 └── #11 fix(ml4w)
  └── #12 fix(install)
   └── #13 fix(theme)
    └── 📍 #14 fix(shell)
     └── #15 refactor(theme)
      └── #16 chore(quality)

Scope

  • Includes: see Changes above
  • Excludes:
  • None

Autonomy

  • CI is expected to pass for this PR branch
  • This PR has one deliverable scope
  • This PR can be rolled back without unrelated changes
  • Tests, docs, or manual verification cover this unit

The LS_COLORS, fzf and bat snippets started with set -euo pipefail; .zshrc sources them, which
turned errexit/nounset on in the interactive shell so the first failing command closed the terminal.
An interactive .zshrc with set -euo pipefail closes the terminal on the first failing command and
breaks plugins. Resolve the theme mode from the persisted live record before an inherited value,
matching fish.
Completes c9cf723: the fzf variants were left out of that commit.
…tive shells

dreamcoder-icons.sh is sourced by .zshrc and .bashrc; its set -euo pipefail closed the terminal on
the first failing command.
@Dreamcoder08

Copy link
Copy Markdown
Owner Author

Verified independently at this slice tip (stacked PRs do not run CI until retargeted to main): pytest exit 0, ruff clean, bats 1 failure. The single bats failure is apply-theme-mode.sh kanagawa bridge carries night-derived colors, which already fails on main; it is removed together with Night in #15 (bats 0 failures there).

@Dreamcoder08
Dreamcoder08 changed the base branch from pr/03-theme-mode-and-listener to main September 29, 2026 20:44
@Dreamcoder08
Dreamcoder08 merged commit 89d8860 into main Sep 29, 2026
@Dreamcoder08
Dreamcoder08 deleted the pr/04-shell-safety branch September 29, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant