diff options
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/atuin-hex/src/lib.rs | 12 |
1 files 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 @@ -451,6 +451,12 @@ mod tests { } #[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); assert!(script.contains("exec atuin hex")); |
