-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
help wantedGreat issue for non-Block contributorsGreat issue for non-Block contributorsp1Priority 1 - High (supports roadmap)Priority 1 - High (supports roadmap)
Description
Bug Description
Users running eval "$(goose term init bash)" in their ~/.bashrc encounter a syntax error:
$ source .bashrc
-bash: eval: line 29: syntax error near unexpected token `{{'
-bash: eval: line 29: `goose_preexec() {{'
Root Cause
In crates/goose-cli/src/commands/term.rs, the bash script template uses {{ and }} which is Rust's format string escape syntax for literal braces. However, the code uses .replace() for string substitution instead of format!(), so the double braces are output literally instead of being converted to single braces.
For example:
goose_preexec() {{
...
}}Outputs goose_preexec() {{ instead of goose_preexec() {.
Proposed Fix
Change {{ to { and }} to } in the BASH_CONFIG template since .replace() is used instead of format!().
Environment
- goose version: 1.18.0
- Shell: bash
Steps to Reproduce
- Add
eval "$(goose term init bash)"to~/.bashrc - Run
source ~/.bashrc - Observe syntax error
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedGreat issue for non-Block contributorsGreat issue for non-Block contributorsp1Priority 1 - High (supports roadmap)Priority 1 - High (supports roadmap)