Skip to content

Fix: eliminate errors on source ~/.zshrc after install#18

Merged
long-910 merged 2 commits intomainfrom
fix/post-install-zshrc-errors
Mar 1, 2026
Merged

Fix: eliminate errors on source ~/.zshrc after install#18
long-910 merged 2 commits intomainfrom
fix/post-install-zshrc-errors

Conversation

@long-910
Copy link
Copy Markdown
Owner

@long-910 long-910 commented Mar 1, 2026

Summary

  • atuin double-init caused (eval):1: can't change option: zle on every shell start: the curl installer appends eval "$(atuin init zsh)" directly to ~/.zshrc, conflicting with .zshrc.d/atuin.zsh
  • starship.toml parse error caused Error parsing "format" on every prompt: (, ), [ inside [text](style) groups were not escaped

Changes

modules/shell.sh

  • Pass ATUIN_NO_MODIFY_SHELL=1 to the atuin curl installer to prevent it from modifying ~/.zshrc
  • Add cleanup step to remove any lines already appended by a previous atuin install

dotfiles/.zshrc.d/atuin.zsh

  • Source ~/.atuin/bin/env before the command -v check so atuin is on $PATH when installed via curl (necessary since ATUIN_NO_MODIFY_SHELL=1 skips env setup)

config/starship.toml

  • Escape (\\(, )\\), [\\[ inside text groups
  • Fix malformed []\n][\\]]\n (closing visual bracket + newline)

Test plan

  • Fresh Linux install via bootstrap.sh --module shell — no errors on first shell open
  • source ~/.zshrc in an existing zsh session — no errors
  • Starship prompt renders correctly: ┌──(@)─[dir git] / └─❯
  • Re-running bootstrap with atuin already installed — cleanup step removes any duplicate lines

🤖 Generated with Claude Code

long-910 and others added 2 commits March 1, 2026 20:41
Two root causes:

1. atuin double-init: the curl installer appends eval "$(atuin init zsh)"
   directly to ~/.zshrc, which conflicts with .zshrc.d/atuin.zsh and causes
   "(eval):1: can't change option: zle" on every shell startup.
   - modules/shell.sh: pass ATUIN_NO_MODIFY_SHELL=1 to the curl installer
   - modules/shell.sh: add cleanup step to remove any already-appended lines
   - dotfiles/.zshrc.d/atuin.zsh: source ~/.atuin/bin/env for PATH setup
     (needed when ATUIN_NO_MODIFY_SHELL=1 skips the env install)

2. starship.toml parse error: (, ), and [ inside text groups [text](style)
   must be escaped as \(, \), \[ in starship format strings; the closing ]
   of the visual bracket and the newline were also malformed ([]\n] → [\]\n).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- atuin.zsh: add `# shellcheck source=/dev/null` before sourcing
  ~/.atuin/bin/env (runtime-generated file, cannot be pre-specified)
- modules/shell.sh: add `# shellcheck disable=SC2016` on the sed line
  where $() in single quotes is an intentional literal match pattern

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@long-910 long-910 merged commit 354dc83 into main Mar 1, 2026
7 checks passed
@long-910 long-910 deleted the fix/post-install-zshrc-errors branch March 1, 2026 11:52
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