Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v18.0.2 #1774

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [18.0.2] - 2024-02-26

### Bug Fixes

- Rework #1509 to recover from the preexec failure ([#1729](https://github.com/atuinsh/atuin/issues/1729))

## [18.0.1] - 2024-02-12

### Bug Fixes
Expand Down
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ members = [
resolver = "2"

[workspace.package]
version = "18.0.1"
version = "18.0.2"
authors = ["Ellie Huxtable <[email protected]>"]
rust-version = "1.67"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion atuin-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sync = ["urlencoding", "reqwest", "sha2", "hex"]
check-update = []

[dependencies]
atuin-common = { path = "../atuin-common", version = "18.0.1" }
atuin-common = { path = "../atuin-common", version = "18.0.2" }

log = { workspace = true }
base64 = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion atuin-server-database/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homepage = { workspace = true }
repository = { workspace = true }

[dependencies]
atuin-common = { path = "../atuin-common", version = "18.0.1" }
atuin-common = { path = "../atuin-common", version = "18.0.2" }

tracing = "0.1"
time = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions atuin-server-postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ homepage = { workspace = true }
repository = { workspace = true }

[dependencies]
atuin-common = { path = "../atuin-common", version = "18.0.1" }
atuin-server-database = { path = "../atuin-server-database", version = "18.0.1" }
atuin-common = { path = "../atuin-common", version = "18.0.2" }
atuin-server-database = { path = "../atuin-server-database", version = "18.0.2" }

tracing = "0.1"
time = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions atuin-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ homepage = { workspace = true }
repository = { workspace = true }

[dependencies]
atuin-common = { path = "../atuin-common", version = "18.0.1" }
atuin-server-database = { path = "../atuin-server-database", version = "18.0.1" }
atuin-common = { path = "../atuin-common", version = "18.0.2" }
atuin-server-database = { path = "../atuin-server-database", version = "18.0.2" }

tracing = "0.1"
time = { workspace = true }
Expand Down
8 changes: 4 additions & 4 deletions atuin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ clipboard = ["cli-clipboard"]
check-update = ["atuin-client/check-update"]

[dependencies]
atuin-server-postgres = { path = "../atuin-server-postgres", version = "18.0.1", optional = true }
atuin-server = { path = "../atuin-server", version = "18.0.1", optional = true }
atuin-client = { path = "../atuin-client", version = "18.0.1", optional = true, default-features = false }
atuin-common = { path = "../atuin-common", version = "18.0.1" }
atuin-server-postgres = { path = "../atuin-server-postgres", version = "18.0.2", optional = true }
atuin-server = { path = "../atuin-server", version = "18.0.2", optional = true }
atuin-client = { path = "../atuin-client", version = "18.0.2", optional = true, default-features = false }
atuin-common = { path = "../atuin-common", version = "18.0.2" }

log = { workspace = true }
env_logger = "0.10.0"
Expand Down
28 changes: 23 additions & 5 deletions atuin/src/shell/atuin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@ export ATUIN_SESSION
ATUIN_HISTORY_ID=""

__atuin_preexec() {
# Workaround for old versions of bash-preexec
if [[ ! ${BLE_ATTACHED-} ]]; then
# With bash-preexec, preexec may be called even for the command run by
# keybindings. There is no general and robust way to detect the
# command for keybindings, but at least we want to exclude Atuin's
# keybindings.
[[ $BASH_COMMAND == '__atuin_history'* && $BASH_COMMAND != "$1" ]] && return 0
# In older versions of bash-preexec, the preexec hook may be called
# even for the commands run by keybindings. There is no general and
# robust way to detect the command for keybindings, but at least we
# want to exclude Atuin's keybindings. When the preexec hook is called
# for a keybinding, the preexec hook for the user command will not
# fire, so we instead set a fake ATUIN_HISTORY_ID here to notify
# __atuin_precmd of this failure.
if [[ $BASH_COMMAND == '__atuin_history'* && $BASH_COMMAND != "$1" ]]; then
ATUIN_HISTORY_ID=__bash_preexec_failure__
return 0
fi
fi

local id
Expand All @@ -36,6 +43,17 @@ __atuin_precmd() {

[[ ! $ATUIN_HISTORY_ID ]] && return

# If the previous preexec hook failed, we manually call __atuin_preexec
if [[ $ATUIN_HISTORY_ID == __bash_preexec_failure__ ]]; then
# This is the command extraction code taken from bash-preexec
local previous_command
previous_command=$(
export LC_ALL=C HISTTIMEFORMAT=''
builtin history 1 | sed '1 s/^ *[0-9][0-9]*[* ] //'
)
__atuin_preexec "$previous_command"
fi

local duration=""
if ((BASH_VERSINFO[0] >= 5)); then
# We use the high-resolution duration based on EPOCHREALTIME (bash >=
Expand Down
Loading