Repository navigation
Conversation
ykakade
marked this pull request as ready for review
October 31, 2026 20:47
antonmedv
reviewed
Oct 31, 2026
| The parent directory must already exist. The file contains JSON and is created | ||
| with owner-only permissions. An unset or empty variable keeps history in memory. | ||
| Only inputs submitted with Enter are saved. Fuzzy JSON path selections (`@`) are | ||
| not saved. Concurrent sessions use the last saved history. |
Owner
There was a problem hiding this comment.
Wtf? I will not merge this readme update.
Author
There was a problem hiding this comment.
Understood. I removed the README change in 23751dd. The PR now changes only the code and tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #332
Set
FX_HISTORY_FILEto keep/searches and interactive queries between fx sessions. Use Up and Down to recall searches, with the current draft restored after the newest entry.How it works
Searches and JavaScript queries use separate arrays in one JSON file. Each history keeps 100 entries and skips consecutive duplicates. Only Enter adds an entry, and
@selections are excluded.Writes use a temporary file with mode 0600 in the same directory, followed by a rename. Read and write errors appear in the command line. Invalid files stay untouched, and fx keeps working with history in memory.
How to test
FX_HISTORY_FILE=/tmp/fx-history.json go run . testdata/example.json./search with Enter, then quit./, then Up.Notes
An unset or empty
FX_HISTORY_FILEkeeps the existing in-memory behavior. The parent directory must exist. Concurrent sessions use the last saved history. History files are limited to 1 MiB.Checklist
FX_HISTORY_FILEgo test ./...go test -race . -run TestHistory -count=1andgo vet ./...node test.jsinnpm