Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Store .delta.lesshst in a location other than Home (Windows) #772

Closed
rashil2000 opened this issue Nov 13, 2021 · 1 comment 路 Fixed by #847
Closed

馃殌 Store .delta.lesshst in a location other than Home (Windows) #772

rashil2000 opened this issue Nov 13, 2021 · 1 comment 路 Fixed by #847

Comments

@rashil2000
Copy link
Contributor

The get_delta_less_hist_file function stores the delta history file in the Home directory on Windows. While on *nix, it stores it in an XDG compliant directory.

#[cfg(target_os = "windows")]
fn get_delta_less_hist_file() -> std::io::Result<PathBuf> {
let mut path = dirs_next::home_dir()
.ok_or_else(|| Error::new(ErrorKind::NotFound, "Can't determine home dir"))?;
path.push(".delta.lesshst");
Ok(path)
}
#[cfg(not(target_os = "windows"))]
fn get_delta_less_hist_file() -> std::io::Result<PathBuf> {
let dir = xdg::BaseDirectories::with_prefix("delta")?;
dir.place_data_file("lesshst")
}

Files beginning with a dot (.) are not hidden files on Windows - this is a *nixism. As such, the home directory looks cluttered when applications create these files.

I'd like to request that the this file be created somewhere else - the official place to store them is in ~/AppData/Local (rough equivalent of XDG_DATA_HOME). The function dirs_next::data_local_dir() can be used to get this.

@dandavison
Copy link
Owner

Hi @rashil2000, thanks very much for opening this, and explaining the issue so clearly. I'm sorry I didn't reply until now, there has been a lot going on with delta! Let's discuss (if needed) in your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants