chore(shell): prompt redraw fixes and 1Password secret docs#4
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bundles three local shell-config changes.
Changes
module_pathtomodule_file.module_pathis a reserved zsh special parameter; clobbering it brokezmodloadfor the session (fzf completion, compinit, Ghostty integration errors).zle reset-promptfrom clobbering command output -- only redraw when git status changed, and move the blank line above the prompt out of PS1 into a precmd hook.local.zsh.example(replaces the old plaintextGITHUB_TOKENplaceholder).Notes
No functional change to the secrets template's active code -- the 1Password example is commented out. The real machine-local
shell-local.zshis gitignored and updated separately.