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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check ownership of history file #552

Closed
tgr opened this issue Mar 8, 2019 · 3 comments
Closed

Check ownership of history file #552

tgr opened this issue Mar 8, 2019 · 3 comments

Comments

@tgr
Copy link
Contributor

tgr commented Mar 8, 2019

libedit apparently refuses to save the history (returns false from readline_write_history) if the history file is not owned by the user, even if it is writable. It would be nice if psysh would warn about this on startup (currently it only warns about the file not being writable) - with the total lack of error reporting in libedit/readline, it is frustrating to debug.

@bobthecow
Copy link
Owner

does it always refuse to write, or just on some operating systems or implementations? should we detect the return false and warn about it then?

@tgr
Copy link
Contributor Author

tgr commented Mar 9, 2019

Ubunut Xenial and Debian Stretch are the ones where I can test easily and those both do it. I didn't find it documented anywhere but then documentation for libedit is not great in general.
Yeah, checking file permissions on return false seems the most robust.

@bobthecow
Copy link
Owner

I was able to reproduce this on macOS as well. I've added a warning when it happens :)

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

No branches or pull requests

2 participants