-
-
Notifications
You must be signed in to change notification settings - Fork 584
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefer PWD environment variable over cwd if available to better support symbolic links #783
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…rt symbolic links
// It's better for atuin to silently fail here and attempt to | ||
// store whatever is ran, than to throw an error to the terminal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not believe this comment is worth keeping as utils::get_current_dir()
returns an empty string if all else fails.
Hmmm. Just so I'm clear |
Yes, precisely. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely reasonable behaviour, and I think the user is more likely to want this
Could consider making it configurable in the future
Thank you!
Just figured it may cause troubles for users already having commands in their history executed from symlinked folders (it was the case for one of mines). Maybe this behavior should be made be opt-in with a configuration option? An alternative would be to allow mass updating commands, but I guess its the same trouble as for deleting records, maybe even harder. |
This PR uses the PWD environment variable if it is available instead of calling
env::current_dir()
.Motivation: I was short on storage space in my main
/home/user
filesystem, so I moved all my/home/user/workspaces
to another disk at/home/newdisk/user/workspaces
, then created a symbolic link from/home/user/workspaces
to/home/newdisk/user/workspaces
.To my dismay, when I searched my command history with the
directory
filter mode, nothing showed up.For reference:
std::env::current_dir
rust-lang/rust#93598 (comment)