Repository navigation
Conversation
akinomyoga
reviewed
Sep 5, 2026
| END { flush_line(); print nline; } | ||
| ' | ||
| ble/builtin/history/.add-rskip "$file" "$_ble_builtin_history_histapp_count" | ||
| # Note: rskip counts lines, and an entry takes two lines with HISTTIMEFORMAT. |
Owner
There was a problem hiding this comment.
I haven't defined whether rskip represents the number of lines or the number of entries. The issue is that some places assume one, and other places assume the other. This PR seems to define it as the number of lines, but I need to think about which should be chosen. Making rskip the number of lines may make it difficult to correctly handle the issue in #721. Also, it seems inconsistent with wskip, which is a source of confusion.
Contributor
Author
|
closing as i will combine it with #721 as it will matter for doing that one correctly |
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.
While fixing the other two issues I found in-memory duplication across tabs.
.write advanced rskip (the number of HISTFILE lines already consumed) by the number of entries it wrote. With HISTTIMEFORMAT every entry takes two lines, and the entries collected by .initialize from history -a were not counted at all, so rskip fell short after each own write. history -a's fetch then picked up this session's own last command as new, and the next time another tab wrote to HISTFILE those commands were loaded again as duplicates.
The awk now counts the lines it writes and rskip is advanced by that number. The program is stored in awk_script so the count can be captured with ble/util/assign, the same pattern .read uses.