`completion install zsh` writes `~/.zshrc` when `$ZDOTDIR` is set, so zsh never loads the completions
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 75/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript, zsh
- Área
- cli
Línea de trabajo
Lee src/core/completions/installers/zsh-installer.ts, especialmente getZshrcPath() y las rutas de instalación, desinstalación e instrucciones manuales que lo usan. Revisa las pruebas del instalador y reproduce el caso con un HOME y un ZDOTDIR temporales; se considera terminado cuando la instalación y la desinstalación tienen como destino ${ZDOTDIR:-$HOME}/.zshrc e indican esa ruta, manteniendo el fallback existente cuando ZDOTDIR no está definido.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What you were trying to do
I was setting up tab completion for OpenSpec in zsh. My zsh config lives in ~/.config/zsh: ~/.zshenv exports ZDOTDIR="$HOME/.config/zsh".
This is a common XDG-style layout. It is also the default in Home Manager when xdg.enable is on and home.stateVersion is 26.05 or later: programs.zsh.dotDir defaults to ~/.config/zsh and is exported as ZDOTDIR. So new Home Manager setups with XDG enabled are affected too.
What happened
$ openspec completion install zsh
✓ Completion script installed and .zshrc configured successfully
Restart your shell or run: exec zsh
The installer created a new ~/.zshrc containing the # OPENSPEC:START … # OPENSPEC:END block. My real config, $ZDOTDIR/.zshrc, was not touched. zsh only reads ~/.zshrc when ZDOTDIR is unset (zsh manual: Startup/Shutdown Files). So the block is never loaded, _openspec never gets on fpath, and completion silently doesn't work even though the install reported success.
openspec completion uninstall zsh has the same problem: it only looks in ~/.zshrc.
What you expected instead
The block goes into the file zsh actually reads, ${ZDOTDIR:-$HOME}/.zshrc. Uninstall removes it from the same file, and the messages name that file.
Minimal steps to reproduce
These steps use a throwaway HOME, so they don't touch your real config:
TMPHOME=$(mktemp -d)
mkdir -p "$TMPHOME/.config/zsh"
echo '# my zshrc' > "$TMPHOME/.config/zsh/.zshrc"
HOME="$TMPHOME" ZDOTDIR="$TMPHOME/.config/zsh" openspec completion install zsh
ls -A "$TMPHOME" # a new .zshrc appears in HOME
cat "$TMPHOME/.config/zsh/.zshrc" # still just "# my zshrc", no OPENSPEC block
HOME="$TMPHOME" ZDOTDIR="$TMPHOME/.config/zsh" zsh -i -c 'whence -v _openspec'
# _openspec not found
With the fix described below, the last command prints _openspec is an autoload shell function from …/.zsh/completions/_openspec.
OpenSpec version
1.14.3 (also reproduces on main at c04f30e5)
Coding agent and model
None. This is plain CLI usage.
OS and Node version
macOS 26 (Darwin 25.5.0, arm64), zsh 5.9, Node 24.21.0
Where it comes from, and an offer to fix it
getZshrcPath() in src/core/completions/installers/zsh-installer.ts builds the path from $HOME only. Install, uninstall and the manual instructions all go through it.
I have a small fix with regression tests:
- It resolves the path from
$ZDOTDIRand falls back to$HOME. Output is identical whenZDOTDIRis unset. - The new tests fail on
mainand pass with the change. The full suite,tscandlintare green.
I'd be glad to open a PR if you'd like me to.
A few things I checked or wasn't sure about:
- IDE terminals. VS Code's zsh shell integration points
ZDOTDIRat its own directory during startup, then restores the user's value (USER_ZDOTDIR) before the prompt. So a command typed in the terminal sees the rightZDOTDIR. - Read-only
.zshrc. Under Home Manager,$ZDOTDIR/.zshrcis usually a read-only symlink into the Nix store. With the fix, the installer's existing write check catches that: it leaves the file alone and prints the manual instructions for the correct path. Today it reports "configured successfully" and drops a stray~/.zshrcinstead. - Script location. I kept the completion script itself in
~/.zsh/completionsto keep the change small. People who setZDOTDIRoften prefer nothing new in$HOME, so I can move it under$ZDOTDIRif you prefer. - The spec. The
cli-completionspec names~/.zshrcliterally. If you'd rather update the spec wording too, I'm happy to follow the feature flow. - Tests. The installer tests would also need to clear
ZDOTDIRthe way they already clearZSH. Otherwise, on a machine withZDOTDIRset, the suite would edit the developer's real.zshrconce the fix lands.
I found this while reading the installer code with Claude Code (Claude Opus 5.5), which also ran the reproduction above on my machine. I reviewed the report and the fix.
- Lenguaje dominante
- TypeScript
- Estrellas
- 73k
- Forks
- 5k
- Merge medio
- 3 d 20 h
- PR fusionados (30 d)
- 69
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Fission-AI/OpenSpec
-
archive and sync skills merge every `specs/**/*.md` as a delta spec, including files `validate` rejectsPosiblemente ocupada @clay-good la tomó hace 1 día. Abiertobug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Fission-AI/OpenSpec#2173 ·
Los mantenedores suelen responder en 2 días
-
openspec-apply-change skill: when blocked, may select a ready artifact unrelated to missingArtifactsPosiblemente ocupada @clay-good la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Fission-AI/OpenSpec#2165 ·
Los mantenedores suelen responder en 2 días
-
openspec-archive-change skill: ignores delta specs when artifact ID is not "specs"Posiblemente ocupada @clay-good la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Fission-AI/OpenSpec#2163 · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
documentation needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 83/100
Fission-AI/OpenSpec#2157 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
documentation needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Fission-AI/OpenSpec#2143 ·
Los mantenedores suelen responder en 2 días
Todos los issues de Fission-AI/OpenSpec
Issues similares
-
BeOS .json missingAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mihaip/infinite-mac#475 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
marmelab/atomic-crm#401 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Deltares/webgl-streamline-visualizer#83 ·
Los mantenedores suelen responder en 1 día
-
ubicloud: usage is an awk syntax error on macOS, which also disables the vCPU quota preflightAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día