Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions crates/goose-cli/src/commands/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}}"#,
}"#,
),
};

Expand All @@ -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
}}"#,
}"#,
),
};

Expand Down