Conversation
Regression from v2.64.0 Fixes: #2374
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 1 critical |
🟢 Metrics 0 complexity
Metric Results Complexity 0
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
While this PR successfully addresses image logo persistence regressions from v2.64.0, it introduces significant logic errors that affect right-aligned logos and ASCII logos taller than the output data when running in --dynamic-interval mode.
Specifically, the logic intended to fix logo overwriting now causes right-aligned logos to be incorrectly shifted and results in the bottom portion of tall ASCII logos being wiped during screen clears. Although the Codacy analysis is 'up to standards', these functional regressions should be addressed to fully satisfy the requirement of fixing logo rendering in dynamic modes.
About this PR
- The PR description is minimal and relies entirely on the CHANGELOG.md and commit history for context and implementation details. Providing a high-level summary of the architectural changes for the logo rendering logic would improve reviewability.
Test suggestions
- Execute fastfetch with --dynamic-interval and verify the logo is not overwritten by subsequent data updates.
- Verify image logo persistence in supported terminals (e.g., Kitty, iTerm2) during dynamic updates.
- Verify right-aligned logo positioning remains consistent across refreshes.
- Check that the screen is properly cleared (no artifacts) when fetch output size changes between dynamic intervals.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Execute fastfetch with --dynamic-interval and verify the logo is not overwritten by subsequent data updates.
2. Verify image logo persistence in supported terminals (e.g., Kitty, iTerm2) during dynamic updates.
3. Verify right-aligned logo positioning remains consistent across refreshes.
4. Check that the screen is properly cleared (no artifacts) when fetch output size changes between dynamic intervals.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| ffLogoPrintRemaining(); // `logoLineCacheClear` inside so that ffLogoPrintLine will use `\e[nC` to move the cursor to the right position instead of reprinting the logo | ||
| fputs("\e[J", stdout); // Clear from cursor to the end of the screen to prevent artifacts when the new output is shorter than the previous one |
There was a problem hiding this comment.
🟡 MEDIUM RISK
On subsequent iterations of the dynamic interval loop, ffLogoPrintRemaining() returns early because the cache is empty. This leaves the cursor at the end of the data lines. The following \e[J then clears the remainder of the screen, effectively wiping out any part of the ASCII logo that is taller than the data output. To fix this, you should ensure the cursor moves to max(logoHeight, keysHeight) before clearing.
| } else if (instance.state.logoWidth > 0) { | ||
| printf("\033[%uC", instance.state.logoWidth); | ||
| } |
There was a problem hiding this comment.
🟡 MEDIUM RISK
This unconditional cursor shift incorrectly affects right-aligned logos. When instance.config.logo.position == FF_LOGO_POSITION_RIGHT, the cursor should not be shifted to the right before printing keys, as they should start from the first column. Currently, this logic will cause keys to overlap the logo or create unwanted whitespace on the left.
There was a problem hiding this comment.
Pull request overview
Release prep for v2.64.2, updating version metadata and documenting/implementing fixes related to logo rendering in --dynamic-interval mode.
Changes:
- Adjust logo line-printing/cursor movement behavior to avoid overwriting and improve compatibility with pipeline colorizers.
- Update dynamic refresh loop to clear trailing screen content between refreshes.
- Bump project version and add
2.64.2changelog entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/logo/logo.c |
Updates logo line cache printing/cursor movement logic and some preprocessor formatting. |
src/fastfetch.c |
Tweaks --dynamic-interval refresh loop (print remaining logo, clear to end-of-screen, reposition cursor). |
CMakeLists.txt |
Bumps project version to 2.64.2. |
CHANGELOG.md |
Adds release notes for 2.64.2. |
Update the large logo for OpenWrt based on the official branding. Add a small logo version. Keep the old logo as openwrt_old.txt Signed-off-by: Valeriy Kosikhin <vkosikhin@gmail.com>
Checklist