Skip to content

chore(shell): prompt redraw fixes and 1Password secret docs#4

Merged
davidham merged 3 commits into
mainfrom
chore/shell-fixes-and-1password-docs
Jun 1, 2026
Merged

chore(shell): prompt redraw fixes and 1Password secret docs#4
davidham merged 3 commits into
mainfrom
chore/shell-fixes-and-1password-docs

Conversation

@davidham

@davidham davidham commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Bundles three local shell-config changes.

Changes

  • fix(shell): rename the module loader's loop var from module_path to module_file. module_path is a reserved zsh special parameter; clobbering it broke zmodload for the session (fzf completion, compinit, Ghostty integration errors).
  • fix(prompt): stop zle reset-prompt from clobbering command output -- only redraw when git status changed, and move the blank line above the prompt out of PS1 into a precmd hook.
  • docs(shell): document the 1Password lazy-load pattern for secrets in local.zsh.example (replaces the old plaintext GITHUB_TOKEN placeholder).

Notes

No functional change to the secrets template's active code -- the 1Password example is commented out. The real machine-local shell-local.zsh is gitignored and updated separately.

davidham added 3 commits June 1, 2026 12:01
The module loader used module_path as its loop variable, but that is a
reserved zsh special parameter (the array tied to MODULE_PATH used to locate
loadable .so modules). Assigning to it and then unsetting it broke zmodload
for the rest of the session, producing errors from fzf's completion.zsh
(zsh/regex), compinit (zsh/complete), and Ghostty's shell integration
(zsh/zleparameter). Rename it to module_file.
zle reset-prompt has geometry quirks when the prompt wraps, and the redraw
triggered from TRAPUSR1 could clear into the previous command's output. Two
changes prevent this:

- Only redraw when the rendered git status actually changed. Consecutive
  commands in the same repo usually produce identical status, so skipping
  those redraws avoids the glitch entirely.
- Print the blank line above the prompt from a precmd hook instead of a
  leading newline in PS1. The leading newline put the recorded prompt-start
  position one line above the prompt content, which combined with Ghostty's
  fresh-line behavior let reset-prompt clear the line above. An accept-line
  wrapper forces precmd to run on a bare Enter so the spacing stays
  consistent.
Replace the plaintext GITHUB_TOKEN placeholder in the local config template
with a commented example showing how to load it lazily from 1Password via
op read, fetching only on first use and caching for the session.
@davidham davidham merged commit be9e01e into main Jun 1, 2026
2 checks passed
@davidham davidham deleted the chore/shell-fixes-and-1password-docs branch June 1, 2026 17:06
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