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

~/.local/share/oils/osh_history interferes with $HISTFILE #2083

Open
nisbet-hubbard opened this issue Sep 27, 2024 · 5 comments
Open

~/.local/share/oils/osh_history interferes with $HISTFILE #2083

nisbet-hubbard opened this issue Sep 27, 2024 · 5 comments

Comments

@nisbet-hubbard
Copy link
Contributor

Currently, even after setting osh’s $HISTFILE to a different location (~/.bash_history in our case) through oshrc, invoking history upon entering an osh lists only the commands stored in the old ~/.local/share/oils/osh_history.

At this moment, at least ~/.bash_history remains intact.

If you then invoke history -a, however, osh replaces the commands in ~/.bash_history (ie $HISTFILE) with those in ~/.local/share/oils/osh_history, with the result that now both $HISTFILE and the history list are populated with the same commands from the old ~/.local/share/oils/osh_history.

@andychu
Copy link
Contributor

andychu commented Sep 28, 2024

Hm so you are setting HISTFILE=foo in oshrc, and it's being ignored?

What about HISTFILE=foo osh , so it's in the environment?

This might be an ordering issue ...


also bash does some weird stuff like calling libc functions when you do LANG=C, I'm not sure if it does something similar when doing HISTFILE=foo, like readline.set_history_file('foo') or something

@nisbet-hubbard
Copy link
Contributor Author

Yes, I can confirm HISTFILE=foo is in the environment. The problem isn’t foo’s being ignored, but that it’s being tampered with using ~/.local/share/oils/osh_history.

So, osh overwrites foo with whatever is in ~/.local/share/oils/osh_history whenever I exit osh.

@andychu
Copy link
Contributor

andychu commented Oct 24, 2024

Hm OK I want to try to repro this ...

@andychu
Copy link
Contributor

andychu commented Oct 29, 2024

I can't reproduce this


HISTFILE=~/.bash_history osh

osh$  history   # now it loads the history from that file

This needs a better repro

in both bash and OSH -- describe the steps, and then describe where OSH differs

@andychu
Copy link
Contributor

andychu commented Oct 30, 2024

After I exit OSH, and it writes the history file, it seems fine too

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