diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-20 23:00:06 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-20 23:00:06 +0200 |
| commit | 2f671f196e245ac1a791c001286e401a2fab9d3a (patch) | |
| tree | be90d8f16d5c8b65c6b77ebe1359d22e9738bbf6 /crates/turtle/src/history/mod.rs | |
| parent | chore: Commit (diff) | |
| download | atuin-2f671f196e245ac1a791c001286e401a2fab9d3a.zip | |
chore: Commit
Diffstat (limited to 'crates/turtle/src/history/mod.rs')
| -rw-r--r-- | crates/turtle/src/history/mod.rs | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/crates/turtle/src/history/mod.rs b/crates/turtle/src/history/mod.rs index 10e74d8e..27755bbe 100644 --- a/crates/turtle/src/history/mod.rs +++ b/crates/turtle/src/history/mod.rs @@ -30,22 +30,6 @@ impl From<String> for HistoryId { } } -pub(crate) fn get_hostname() -> String { - env::var("ATUIN_HOST_NAME") - .unwrap_or_else(|_| whoami::hostname().unwrap_or_else(|_| "unknown-host".to_string())) -} - -pub(crate) fn get_username() -> String { - env::var("ATUIN_HOST_USER") - .unwrap_or_else(|_| whoami::username().unwrap_or_else(|_| "unknown-user".to_string())) -} - -/// Returns a pair of the hostname and username, separated by a colon. -#[must_use] -pub fn get_host_user() -> String { - format!("{}:{}", get_hostname(), get_username()) -} - /// Client-side history entry. /// /// Client stores data unencrypted, and only encrypts it before sending to the server. @@ -123,16 +107,12 @@ impl History { cwd: String, exit: i64, duration: i64, - session: Option<String>, - hostname: Option<String>, + session: String, + hostname: String, author: Option<String>, intent: Option<String>, deleted_at: Option<OffsetDateTime>, ) -> Self { - let session = session - .or_else(|| env::var("ATUIN_SESSION").ok()) - .unwrap_or_else(|| uuid_v7().as_simple().to_string()); - let hostname = hostname.unwrap_or_else(get_host_user); let author = Self::normalize_optional_field(author) .or_else(|| Self::normalize_optional_field(env::var(HISTORY_AUTHOR_ENV).ok())) .unwrap_or_else(|| Self::author_from_hostname(hostname.as_str())); |
