From c90c781a32af4304e647231be2a74a444f632a99 Mon Sep 17 00:00:00 2001 From: Jonas Maier <> Date: Sun, 8 Mar 2026 08:39:04 +0100 Subject: history with paths --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 9a4e692..3687cd0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use std::collections::HashMap; +use std::env::current_dir; use std::ffi::OsStr; use std::fs; use std::io::{self, IsTerminal, Read, Write}; @@ -60,7 +61,13 @@ type bstr = [u8]; #[derive(Clone)] struct HistoryEntry { + /// time of execution pub time: date::DateTime, + + /// absolute path where the command was executed + pub loc: BString, + + /// the command pub cmd: BString, } @@ -68,6 +75,7 @@ impl HistoryEntry { pub fn new(cmd: BString) -> Self { Self { time: date::DateTime::now(), + loc: current_dir().unwrap().as_os_str().as_encoded_bytes().to_vec(), cmd, } } -- cgit v1.2.3