Ensure correct filename is displayed in Start/Stop messages#69
Open
pahindman wants to merge 6 commits intotmux-plugins:masterfrom
Open
Ensure correct filename is displayed in Start/Stop messages#69pahindman wants to merge 6 commits intotmux-plugins:masterfrom
pahindman wants to merge 6 commits intotmux-plugins:masterfrom
Conversation
added 2 commits
May 18, 2024 11:42
Previously the filename was calculated twice: first when opening the file, and then when displaying the message. There is a small chance that the time would change between those two events, causing the displayed filename to be incorrect. This change calculates the name once and then uses that name in both places.
a68ee0a to
5085290
Compare
5085290 to
23dc333
Compare
added 4 commits
September 28, 2024 13:05
Use a pane option variable, and remove unnecessary script variables.
Set it in start_pipe_pane, unset it in stop_pipe_pane, and determine whether logging is on by whether it is set or unset.
Since the string stored in @logging-variable can be arbitrary, let's store the filename there, so that we can display the correct name when we stop logging.
The name of the file that the current pane is logging to is stored in the variable, so name it (and the helper functions) accordingly.
23dc333 to
5f03ad0
Compare
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.
When starting logging it was possible for the filename displayed to be different than the actual filename used (though probably at most off by 1 second). More importantly, when stopping logging the filename displayed would be constructed at the time that logging was stopped, so would almost never be correct. This PR fixes both by repurposing the pane-specific
logging_variableto hold the filename being logged to.