Skip to content

Fix TERM fallback in generated .zshrc - #36

Open
seven-mile wants to merge 1 commit into
deluan:masterfrom
seven-mile:fix-term-fallback-expansion
Open

Fix TERM fallback in generated .zshrc#36
seven-mile wants to merge 1 commit into
deluan:masterfrom
seven-mile:fix-term-fallback-expansion

Conversation

@seven-mile

Copy link
Copy Markdown

#30 made the TERM default conditional, but the line lives inside zshrc_template()'s
unquoted heredoc, so $TERM is expanded while ~/.zshrc is generated instead of being
written literally. The install-time value gets baked in:

[ -z "" ] && export TERM=xterm          # TERM unset at install: always overrides TERM
[ -z "xterm" ] && export TERM=xterm     # TERM set at install: fallback never fires

During docker build TERM is usually unset, so the guard is always true and the line is
equivalent to the unconditional export TERM=xterm that #30 replaced — passing
--env=TERM=xterm-256color still has no effect.

Escaping the $ defers the check to shell startup, so ~/.zshrc gets
[ -z "$TERM" ] && export TERM=xterm regardless of the build environment.

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