Respect HISTFILE for bash history too

This commit is contained in:
David Dworken 2022-11-09 15:15:08 -08:00
parent ed3c67daf9
commit 6ded150f4a
No known key found for this signature in database

View File

@ -622,7 +622,11 @@ func parseFishHistory(homedir string) ([]string, error) {
}
func parseBashHistory(homedir string) ([]string, error) {
return readFileToArray(filepath.Join(homedir, ".bash_history"))
histfile := os.Getenv("HISTFILE")
if histfile == "" {
histfile = filepath.Join(homedir, ".bash_history")
}
return readFileToArray(histfile)
}
func readFileToArray(path string) ([]string, error) {