Hacker News new | ask | show | jobs
by herdrick 5120 days ago
Under the known bugs and issues:

History file should apply some kind of maximum history length

Fine, but the default needs to be large, like 100MB. Disks are big now. I hope ridiculousfish agrees.

3 comments

Hi, ridi here!

This bug is actually fixed with my changes (see the release notes at http://ridiculousfish.com/shell/release_notes.html). The maximum history length is now 250k unique items, with an LRU discard policy. A full history would be around 15 MB.

Processing time is one concern. fish doesn't do anything as clumsy as keeping the entire file in memory, but scanning a large history file can still add up.

But the larger concern is writing it out. fish saves its history atomically by writing an entirely new file to disk, and swapping it in. You may not notice a 100 MB file, but you would probably notice a frequent 100 MB write!

fish saves its history atomically by writing an entirely new file to disk, and swapping it in

That's so you get sync'd histories across one user's logins? Good feature, but I need my history. It's invaluable to me. Still, maybe 250k lines is enough. Is there a way I could bump that up and judge for myself the consequences?

Thanks for the reply and for picking up this project. So far I'm loving the extra interactivity of fish.
Disks are big, but I think 100MB is maybe a bit excessive...even 10MB gives you 40k lines of history, at 256 bytes per line, and that is a conservative estimate.
400k lines sounds like less than a lifetime at the terminal. So maybe 200MB would be safer - thanks for the reminder! ;)
100 MB is indeed small but there are privacy concerns with storing hundreds of thousands of lines of history. Do you really want every command you've typed for the last several years to be visible to anyone with physical access to your box? It could contain clear-text passwords to other machines.

I'd be happy with 100 MB as a maximum size but there should also be time-based limits, like remove anything from history that is older than a few months.

Just FYI, You can hide sensitive commands (like those that require you to type your password in plain!) in bash, by simply adding an space at the beginning (after adding `export HISTCONTROL=ignorespace` in your bash_profile, of course). I don't know about fish yet.

more: http://www.linuxjournal.com/content/using-bash-history-more-...

Do you really want every command you've typed for the last several years

Yes.

visible to anyone with physical access to your box

Maybe not. That's an auth problem, not a reason to throw away your archives. I keep all my email even though there's probably something in there embarrassing to me given some audience.