Skip to content

Commit

Permalink
Fix LF (Linefeed) getting into history
Browse files Browse the repository at this point in the history
  • Loading branch information
Phileas Lebada committed Feb 13, 2024
1 parent 4a77e3f commit dab5207
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion atuin/src/shell/atuin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ export ATUIN_SESSION=$(atuin uuid)
ATUIN_HISTORY_ID=""

_atuin_preexec() {
# remove ^J from end of $1 as it's passed by zshaddhistory
local cmd="${1[0, -2]}"
# skip history for empty calls
# remove space, \t, \n, and literal '\'
[[ -n "${${1//[[:space:]]/}//\\/}" ]] || return
local id
id=$(atuin history start -- "$1")
id=$(atuin history start -- "$cmd")
export ATUIN_HISTORY_ID="$id"
__atuin_preexec_time=${EPOCHREALTIME-}
}
Expand Down

0 comments on commit dab5207

Please sign in to comment.