From c6e0f847d62aafdbf091e57ec601f4d47dc24512 Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Tue, 24 Mar 2026 09:43:12 -0700 Subject: fix: Atuin Hex fails to init on bash and zsh (#3341) Fixes #3340 --- crates/atuin-hex/src/lib.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/atuin-hex/src/lib.rs b/crates/atuin-hex/src/lib.rs index feed6e36..0bfe54d8 100644 --- a/crates/atuin-hex/src/lib.rs +++ b/crates/atuin-hex/src/lib.rs @@ -95,10 +95,10 @@ fn render_init(shell: Shell) -> &'static str { match shell { Shell::Bash | Shell::Zsh => { r#"if [[ "$-" == *i* ]] && [[ -t 0 ]] && [[ -t 1 ]]; then - _atuin_hex_tmux_current="${{TMUX:-}}" - _atuin_hex_tmux_previous="${{ATUIN_HEX_TMUX:-}}" + _atuin_hex_tmux_current="${TMUX:-}" + _atuin_hex_tmux_previous="${ATUIN_HEX_TMUX:-}" - if [[ -z "${{ATUIN_HEX_ACTIVE:-}}" ]] || [[ "$_atuin_hex_tmux_current" != "$_atuin_hex_tmux_previous" ]]; then + if [[ -z "${ATUIN_HEX_ACTIVE:-}" ]] || [[ "$_atuin_hex_tmux_current" != "$_atuin_hex_tmux_previous" ]]; then export ATUIN_HEX_ACTIVE=1 export ATUIN_HEX_TMUX="$_atuin_hex_tmux_current" exec atuin hex @@ -450,6 +450,12 @@ mod tests { assert!(!script.contains("eval \"$(atuin init bash)\"")); } + #[test] + fn posix_init_has_no_double_braces() { + let script = render_init(Shell::Bash); + assert!(!script.contains("${{"), "double braces in bash init script"); + } + #[test] fn fish_init_uses_source() { let script = render_init(Shell::Fish); -- cgit v1.3.1