Open
Conversation
|
This PR's commit fixes the bug for me (when both |
Closed
iiey
added a commit
to iiey/dotfiles
that referenced
this pull request
Aug 23, 2024
remove 'format_time' it's not working since v2.14 i3/i3status#465 description about tztime: https://i3wm.org/docs/i3status.html#_tztime
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.
Problem
It seems that
format_timeoftztimedoesn't works correctly after v2.14.If the configuration is written as follows, the string expected to be printed is
"<span foreground='#ee9a00'>21-11-14 (Sun) 02:27:51</span>"but I got"%y-%m-%d (%a) %H:%M:%S".The detailed behavior of
format_timeis described in the doc: https://i3wm.org/docs/i3status.html#_tztimeCause
The cause is that
formatis not correctly used.formatshould be used when printing butformat_timeis used in v2.14.The source code of the previous version v2.13 uses
format.https://github.com/i3/i3status/blame/101215bbc83b97de30b6b535bbe2e93d2e913804/src/print_time.c#L68-L77
This pull request fixes it.
Workaround
You can use
%informatdirectly.Another issue
maybe_escape_markupwas used in previous versions to sanitize date-time string formatted withformat_time,https://github.com/i3/i3status/blame/101215bbc83b97de30b6b535bbe2e93d2e913804/src/print_time.c#L74
Although, it doesn't care about the length of the buffer, I think it can lead to buffer overflow.
It seems that
maybe_escape_markupis not used in the current implementation.In other words, the current behavior is the same as if
format_timewas not used andstrftimeformat was used informat.I want to keep it as is and I think it is better to be fixed in the another pull request because I think it's rare that the output text is long, so I don't think it's a big problem as it is.