From d0e17300e52534e85c1943d4b4701e6d76559d79 Mon Sep 17 00:00:00 2001 From: rektide Date: Mon, 12 Jan 2026 18:55:36 +0000 Subject: feat: add session and uuid column support to history list (#3049) Hello. Small PR to add two new columns to the command history, the `session` and the `uuid` for the history. Having these identifiers available can help people do more advanced scripting & comprehension of their history. ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing --- crates/atuin/src/command/client/history.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/atuin/src/command/client/history.rs b/crates/atuin/src/command/client/history.rs index 177ec82e..c85f6c49 100644 --- a/crates/atuin/src/command/client/history.rs +++ b/crates/atuin/src/command/client/history.rs @@ -85,7 +85,7 @@ pub enum Cmd { #[arg(long, visible_alias = "tz")] timezone: Option, - /// Available variables: {command}, {directory}, {duration}, {user}, {host}, {exit} and {time}. + /// Available variables: {command}, {directory}, {duration}, {user}, {host}, {exit}, {time}, {session}, and {uuid} /// Example: --format "{time} - [{duration}] - {directory}$\t{command}" #[arg(long, short)] format: Option, @@ -108,7 +108,7 @@ pub enum Cmd { #[arg(long, visible_alias = "tz")] timezone: Option, - /// Available variables: {command}, {directory}, {duration}, {user}, {host} and {time}. + /// Available variables: {command}, {directory}, {duration}, {user}, {host}, {time}, {session}, {uuid} and {relativetime}. /// Example: --format "{time} - [{duration}] - {directory}$\t{command}" #[arg(long, short)] format: Option, @@ -320,6 +320,8 @@ impl FormatKey for FmtHistory<'_> { .split_once(':') .map_or("", |(_, user)| user), )?, + "session" => f.write_str(&self.history.session)?, + "uuid" => f.write_str(&self.history.id.0)?, _ => return Err(FormatKeyError::UnknownKey), } Ok(()) -- cgit v1.3.1