Skip to content
Open
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
11 changes: 1 addition & 10 deletions src/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,7 @@ impl HistoryProvider {
pub fn history_stream(&self) -> Result<Box<dyn Read>, Box<dyn Error>> {
match self {
HistoryProvider::Zsh | HistoryProvider::Bash => {
let shell = self.to_string();
let output = Command::new(shell)
.args(["-i", "-c", r#"echo -e "\n$HISTFILE""#])
.output()?;

let file_path = std::str::from_utf8(&output.stdout)?
.trim()
.lines()
.last()
.expect("env $HISTFILE not set");
let file_path = std::env::var("HISTFILE").expect("env $HISTFILE not set");
Ok(Box::new(File::open(file_path)?))
}
HistoryProvider::Atuin => {
Expand Down