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
12 changes: 9 additions & 3 deletions crates/atuin-hex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down