From 04d27a861467d707177dbd3bab725e5cfcd3f8bf Mon Sep 17 00:00:00 2001 From: long-910 <7323488+long-910@users.noreply.github.com> Date: Sun, 1 Mar 2026 20:41:58 +0900 Subject: [PATCH 1/2] Fix: eliminate errors on source ~/.zshrc after install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- config/starship.toml | 2 +- dotfiles/.zshrc.d/atuin.zsh | 3 +++ modules/shell.sh | 24 ++++++++++++++++++------ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/config/starship.toml b/config/starship.toml index 92d3850..6d6bc3d 100644 --- a/config/starship.toml +++ b/config/starship.toml @@ -4,7 +4,7 @@ format = """ $username\ $hostname\ -[┌──(](bold green)$username[@](bold green)$hostname[)─[](bold green)$directory[$git_branch$git_status](bold green)[]\n](bold green)\ +[┌──\\(](bold green)$username[@](bold green)$hostname[\\)─\\[](bold green)$directory[$git_branch$git_status](bold green)[\\]](bold green)\n\ $git_state\ $nodejs$python$rust$golang\ $cmd_duration\ diff --git a/dotfiles/.zshrc.d/atuin.zsh b/dotfiles/.zshrc.d/atuin.zsh index fa2fb5e..dbb6d7e 100644 --- a/dotfiles/.zshrc.d/atuin.zsh +++ b/dotfiles/.zshrc.d/atuin.zsh @@ -2,6 +2,9 @@ # ~/.zshrc.d/atuin.zsh — Atuin shell history # --disable-up-arrow keeps default ↑ behavior; use Ctrl-R for atuin search +# Add ~/.atuin/bin to PATH when installed via curl installer +[ -f "$HOME/.atuin/bin/env" ] && . "$HOME/.atuin/bin/env" + if command -v atuin >/dev/null 2>&1; then eval "$(atuin init zsh --disable-up-arrow)" fi diff --git a/modules/shell.sh b/modules/shell.sh index 6ad3628..08c43db 100755 --- a/modules/shell.sh +++ b/modules/shell.sh @@ -67,13 +67,25 @@ _install_zoxide() { _install_atuin() { if has_cmd atuin; then info "atuin already installed" - return - fi - info "Installing atuin..." - if [ "$PKG_MGR" = "brew" ]; then - brew install atuin else - curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh + info "Installing atuin..." + if [ "$PKG_MGR" = "brew" ]; then + brew install atuin + else + # ATUIN_NO_MODIFY_SHELL=1 prevents atuin's installer from appending + # init code to ~/.zshrc — our .zshrc.d/atuin.zsh handles that instead. + ATUIN_NO_MODIFY_SHELL=1 curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | ATUIN_NO_MODIFY_SHELL=1 sh + fi + fi + + # Remove any lines atuin's installer may have already appended to ~/.zshrc. + # These duplicate the .zshrc.d/atuin.zsh setup and cause + # "(eval):1: can't change option: zle" on every shell start. + if grep -q '\.atuin/bin/env\|atuin init' "${HOME}/.zshrc" 2>/dev/null; then + info "Removing duplicate atuin init lines from ~/.zshrc..." + sed -i '/^\. ".*\.atuin\/bin\/env"/d' "${HOME}/.zshrc" + sed -i '/^eval "\$(atuin init/d' "${HOME}/.zshrc" + success "Cleaned up ~/.zshrc" fi } From 08572fda720d645d110af36fc8989fb3e226a0e4 Mon Sep 17 00:00:00 2001 From: long-910 <7323488+long-910@users.noreply.github.com> Date: Sun, 1 Mar 2026 20:46:31 +0900 Subject: [PATCH 2/2] Fix: resolve ShellCheck SC1091 and SC2016 notes - 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 --- dotfiles/.zshrc.d/atuin.zsh | 1 + modules/shell.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/dotfiles/.zshrc.d/atuin.zsh b/dotfiles/.zshrc.d/atuin.zsh index dbb6d7e..4903a0f 100644 --- a/dotfiles/.zshrc.d/atuin.zsh +++ b/dotfiles/.zshrc.d/atuin.zsh @@ -3,6 +3,7 @@ # --disable-up-arrow keeps default ↑ behavior; use Ctrl-R for atuin search # Add ~/.atuin/bin to PATH when installed via curl installer +# shellcheck source=/dev/null [ -f "$HOME/.atuin/bin/env" ] && . "$HOME/.atuin/bin/env" if command -v atuin >/dev/null 2>&1; then diff --git a/modules/shell.sh b/modules/shell.sh index 08c43db..d0bf588 100755 --- a/modules/shell.sh +++ b/modules/shell.sh @@ -84,6 +84,7 @@ _install_atuin() { if grep -q '\.atuin/bin/env\|atuin init' "${HOME}/.zshrc" 2>/dev/null; then info "Removing duplicate atuin init lines from ~/.zshrc..." sed -i '/^\. ".*\.atuin\/bin\/env"/d' "${HOME}/.zshrc" + # shellcheck disable=SC2016 # $() in single quotes is intentional (literal match) sed -i '/^eval "\$(atuin init/d' "${HOME}/.zshrc" success "Cleaned up ~/.zshrc" fi