Skip to content

Commit fde89df

Browse files
ret2libcclaude
andauthored
Fix Jinja2 escaping of zsh PROMPT in cloud-init template (#41)
* Fix Jinja2 escaping of zsh PROMPT in cloud-init template The zsh PROMPT string contains `%` sequences that Jinja2 interprets as template syntax. Wrap in {% raw %}...{% endraw %} to preserve the literal prompt definition. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add a warning to the cloud-init jinja template --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5982a3b commit fde89df

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

dropkit/templates/default-cloud-init.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#cloud-config
2+
# Warning: This whole file will be evaluated by Jinja. Escape any special literals (`{{`, `{%`, `{#`).
23

34
# Update and upgrade system packages
45
package_update: true
@@ -47,7 +48,7 @@ write_files:
4748
defer: true
4849
content: |
4950
# Prompt: user@host:dir (green for normal, red after failed command)
50-
PROMPT='%F{%(?.green.red)}%n@%m%f:%F{blue}%~%f$ '
51+
{% raw %}PROMPT='%F{%(?.green.red)}%n@%m%f:%F{blue}%~%f$ '{% endraw %}
5152
5253
# History
5354
HISTFILE=~/.zsh_history

0 commit comments

Comments
 (0)