link-grammar
link-grammar copied to clipboard
Stop litering `.lg_history` in current directory.
Currently, this line:
https://github.com/opencog/link-grammar/blob/af7033e541160a0d0b941d9ed70c7dff7f979361/link-parser/lg_readline.c#L375
causes the .lg_history
file to be written in the current working directory, resulting in LG litter everywhere. It's getting annoying. It should be changed to either ~/.lg_history
or to ~/.cache/link-grammar/lg_history
I tried changing it to ~/.lg_history
but that did not work. Seems that history_w(hist, &ev, H_LOAD, HFILE);
does not know what to do with the tilde. And, at any rate, this won't work in windows, anyway. So I'm opening this bug report instead ...
There is a function expand_homedir()
in parser-utilities.h
.
There is a comment there:
* Note: ~user is not supported here on Windows.
However, it seems this is a comment rot since the code seem to support Windows (and 54f672357f46a6f1b37feb3159054592e896368b says I tested it).
Cool, thanks, I'll trying hacking that up, unless you want to do it.
Please do it, because I'm preparing yet some other PRs just now.
Fixed, in #1446 for Linux only. I'm leaving this open, for Windows and Apple. Should be easy; just .. different #defines, right?
Closing because resolved in #1447.
Closed wrong issue.
See comments in #1446 for current status
I have just submitted PR #1534 - XDG-base-directory implementation that has per-dict history.