From 77ffb6fa8ab0b9ed06582a26a3cae87c108a541b Mon Sep 17 00:00:00 2001 From: Josh Noll Date: Thu, 18 Dec 2025 18:04:06 -0500 Subject: [PATCH] fix(cli): correct bash syntax in terminal integration functions Fixed bash syntax error by changing double curly braces to single curly braces in function definitions for bash and zsh terminal integration. The double braces were being output literally, causing 'syntax error near unexpected token' errors. Changes: - goose_preexec() function definitions in BASH_CONFIG and ZSH_CONFIG - command_not_found_handle/handler() function definitions Fixes the error: bash: eval: line 100: syntax error near unexpected token '{{' bash: eval: line 100: 'goose_preexec() {{' Signed-off-by: Josh Noll --- crates/goose-cli/src/commands/term.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/goose-cli/src/commands/term.rs b/crates/goose-cli/src/commands/term.rs index 3d928ee294e1..c9bdfc859099 100644 --- a/crates/goose-cli/src/commands/term.rs +++ b/crates/goose-cli/src/commands/term.rs @@ -39,11 +39,11 @@ static BASH_CONFIG: ShellConfig = ShellConfig { alias @goose='{goose_bin} term run' alias @g='{goose_bin} term run' -goose_preexec() {{ +goose_preexec() { [[ "$1" =~ ^goose\ term ]] && return [[ "$1" =~ ^(@goose|@g)($|[[:space:]]) ]] && return ('{goose_bin}' term log "$1" &) 2>/dev/null -}} +} if [[ -z "$goose_preexec_installed" ]]; then goose_preexec_installed=1 @@ -52,11 +52,11 @@ fi{command_not_found_handler}"#, command_not_found: Some( r#" -command_not_found_handle() {{ +command_not_found_handle() { echo "🪿 Command '$1' not found. Asking goose..." '{goose_bin}' term run "$@" return 0 -}}"#, +}"#, ), }; @@ -65,22 +65,22 @@ static ZSH_CONFIG: ShellConfig = ShellConfig { alias @goose='{goose_bin} term run' alias @g='{goose_bin} term run' -goose_preexec() {{ +goose_preexec() { [[ "$1" =~ ^goose\ term ]] && return [[ "$1" =~ ^(@goose|@g)($|[[:space:]]) ]] && return ('{goose_bin}' term log "$1" &) 2>/dev/null -}} +} autoload -Uz add-zsh-hook add-zsh-hook preexec goose_preexec{command_not_found_handler}"#, command_not_found: Some( r#" -command_not_found_handler() {{ +command_not_found_handler() { echo "🪿 Command '$1' not found. Asking goose..." '{goose_bin}' term run "$@" return 0 -}}"#, +}"#, ), };