-
-
Notifications
You must be signed in to change notification settings - Fork 793
Release v2.64.2 #2375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release v2.64.2 #2375
Changes from all commits
ba39687
6b9f594
53c2d07
e79aaf5
20aabdf
727fbc0
da568c9
a139a8c
9fe7d6d
70e6717
4d3b6c3
fc7a0a8
cbc84fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -765,9 +765,12 @@ static void run(FFdata* data) { | |
| } | ||
|
|
||
| if (instance.state.dynamicInterval > 0) { | ||
| 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 | ||
|
Comment on lines
+768
to
+769
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM RISK On subsequent iterations of the dynamic interval loop, |
||
| fflush(stdout); | ||
| ffTimeSleep(instance.state.dynamicInterval); | ||
| fputs("\e[H", stdout); | ||
| fputs("\e[H", stdout); // Move cursor to the top left corner to overwrite the previous output | ||
|
CarterLi marked this conversation as resolved.
|
||
| instance.state.keysHeight = 0; // Reset keysHeight so `ffLogoPrintRemaining` will recalculate it | ||
| } else { | ||
| break; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,18 @@ | ||
| _______ | ||
| | |.-----.-----.-----. | ||
| | - || _ | -__| | | ||
| |_______|| __|_____|__|__| | ||
| |__| | ||
| ________ __ | ||
| | | | |.----.| |_ | ||
| | | | || _|| _| | ||
| |________||__| |____| | ||
| ..,,.. | ||
| ,;odOMMMMMMMMObo:. | ||
| ,odOMMMMMO""''""OMMMMMObo. | ||
| .dMMMM" .,,. "OMMMb, | ||
| '0" ,;ddMMMMMMMMbb:. "0' | ||
| oOMMMMO""''""OMMMMOo | ||
| $2;. $1'0" .,,. "0' $2.: | ||
| .OMM* $1.odMMMMMMbo. $2*MMO. | ||
| MMMO $1"0"````"0" $2OMMM | ||
| iOMM $1.oo. $2MMMi | ||
| OMMl $1:MMMM: $2lMMO | ||
| iMMM $1'oo' $2MMMi | ||
| OMMb $2dMMO | ||
| 'OMMO. ,OMMO' | ||
| "MMMb. ,dMMM" | ||
| "MMMMbgo-,,-ogdMMMM" | ||
| "*MMMMMMMMMM*" | ||
| `'""'` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| _______ | ||
| | |.-----.-----.-----. | ||
| | - || _ | -__| | | ||
| |_______|| __|_____|__|__| | ||
| |__| | ||
| ________ __ | ||
| | | | |.----.| |_ | ||
| | | | || _|| _| | ||
| |________||__| |____| |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| ..,.. | ||
| ,odM"""""Mbo, | ||
| `.odMMMMMbo.` | ||
| $2d,$1" ,mmm, "$2,b | ||
| iM $1" . " $2Mi | ||
| Ml $1dMb $2lM | ||
| 'M, $1' $2.M' | ||
| "0b. ,d0" | ||
| `"WWWWW"` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -461,7 +461,7 @@ static bool updateLogoPath(void) { | |
| return true; | ||
| } | ||
|
|
||
| #if !FF_MODULE_DISABLE_MEDIA | ||
| #if !FF_MODULE_DISABLE_MEDIA | ||
| if (ffStrbufIgnCaseEqualS(&options->source, "media-cover")) { | ||
| const FFMediaResult* media = ffDetectMedia(true); | ||
| if (media->cover.length == 0) { | ||
|
|
@@ -470,7 +470,7 @@ static bool updateLogoPath(void) { | |
| ffStrbufSet(&options->source, &media->cover); | ||
| return true; | ||
| } | ||
| #endif | ||
| #endif | ||
|
|
||
| FF_STRBUF_AUTO_DESTROY fullPath = ffStrbufCreateA(128); | ||
| if (ffPathExpandEnv(options->source.chars, &fullPath) && ffPathExists(fullPath.chars, FF_PATHTYPE_FILE)) { | ||
|
|
@@ -639,7 +639,7 @@ void ffLogoPrint(void) { | |
| } | ||
|
|
||
| if (!ffStrbufEndsWithIgnCaseS(&options->source, ".txt")) { | ||
| #if !FF_MODULE_DISABLE_TERMINAL | ||
| #if !FF_MODULE_DISABLE_TERMINAL | ||
| const FFTerminalResult* terminal = ffDetectTerminal(); | ||
|
|
||
| bool supportsIterm2 = ffStrbufEqualS(&terminal->prettyName, "iTerm"); | ||
|
|
@@ -655,15 +655,15 @@ void ffLogoPrint(void) { | |
| ffStrbufIgnCaseEqualS(&terminal->processName, "wezterm") || | ||
| ffStrbufIgnCaseEqualS(&terminal->processName, "wayst") || | ||
| ffStrbufIgnCaseEqualS(&terminal->processName, "ghostty") || | ||
| #ifdef __APPLE__ | ||
| #ifdef __APPLE__ | ||
| ffStrbufIgnCaseEqualS(&terminal->processName, "WarpTerminal") || | ||
| #else | ||
| #else | ||
| ffStrbufIgnCaseEqualS(&terminal->processName, "warp") || | ||
| #endif | ||
| #endif | ||
|
CarterLi marked this conversation as resolved.
|
||
| false; | ||
| #else | ||
| #else | ||
| bool supportsKitty = false; | ||
| #endif | ||
| #endif | ||
|
|
||
| // Try to load the logo as an image. If it succeeds, print it and return. | ||
| if (logoPrintImageIfExists(supportsKitty ? FF_LOGO_TYPE_IMAGE_KITTY : FF_LOGO_TYPE_IMAGE_CHAFA, false)) { | ||
|
|
@@ -685,37 +685,39 @@ void ffLogoPrint(void) { | |
| } | ||
|
|
||
| void ffLogoPrintLine(void) { | ||
| uint32_t printedLineWidth = 0; | ||
| FFLogoLineCacheState* cache = &instance.state.logoLineCache; | ||
| FFOptionsLogo* logo = &instance.config.logo; | ||
|
|
||
| if (cache->lines.length > 0 && (logo->position == FF_LOGO_POSITION_LEFT || logo->position == FF_LOGO_POSITION_RIGHT) && cache->nextLine < cache->lines.length) { | ||
| FFLogoCachedLine* line = FF_LIST_GET(FFLogoCachedLine, cache->lines, cache->nextLine); | ||
| if (cache->lines.length > 0) { | ||
| // Line cache is enabled. Always move cursor with whitespaces to make lolcat happy | ||
| if (cache->nextLine < cache->lines.length) { | ||
| // Print logo line and move cursor | ||
| FFLogoCachedLine* line = FF_LIST_GET(FFLogoCachedLine, cache->lines, cache->nextLine); | ||
|
|
||
| if (logo->position == FF_LOGO_POSITION_RIGHT && line->chars.length > 0) { | ||
| printf("\033[9999999C\033[%uD", cache->rightOffset); | ||
| ffStrbufWriteTo(&line->chars, stdout); | ||
| fputs("\033[G", stdout); | ||
| } else { | ||
| ffStrbufWriteTo(&line->chars, stdout); | ||
| printedLineWidth = line->width; | ||
| } | ||
| if (logo->position == FF_LOGO_POSITION_RIGHT) { | ||
| printf("\033[9999999C\033[%uD", cache->rightOffset); | ||
| ffStrbufWriteTo(&line->chars, stdout); | ||
|
|
||
| ++cache->nextLine; | ||
| } | ||
| fputs("\033[G", stdout); | ||
| } else { | ||
| ffStrbufWriteTo(&line->chars, stdout); | ||
|
|
||
| if (instance.state.logoWidth > 0) { | ||
| if (instance.config.logo.position == FF_LOGO_POSITION_LEFT) { | ||
| uint32_t remaining = instance.state.logoWidth; | ||
| remaining = printedLineWidth < remaining ? remaining - printedLineWidth : 0; | ||
| ffPrintCharTimes(' ', remaining); | ||
| } else { | ||
| printf("\033[%uC", instance.state.logoWidth); | ||
| uint32_t remaining = instance.state.logoWidth; | ||
| remaining = line->width < remaining ? remaining - line->width : 0; | ||
| ffPrintCharTimes(' ', remaining); | ||
| } | ||
| ++cache->nextLine; | ||
| } else if (logo->position == FF_LOGO_POSITION_LEFT) { | ||
| // Move cursor to the start position | ||
| ffPrintCharTimes(' ', instance.state.logoWidth); | ||
| } | ||
| } else if (instance.state.logoWidth > 0) { | ||
| printf("\033[%uC", instance.state.logoWidth); | ||
| } | ||
|
Comment on lines
+714
to
716
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM RISK This unconditional cursor shift incorrectly affects right-aligned logos. When |
||
|
|
||
| if (instance.state.dynamicInterval > 0) { | ||
| if (instance.state.dynamicInterval > 0 && logo->position == FF_LOGO_POSITION_LEFT) { | ||
| fputs("\033[K", stdout); // Clear to the end of the line | ||
| // Note that we don't clear the line when the logo is on the right, as it will also clear the logo itself | ||
| } | ||
|
|
||
| ++instance.state.keysHeight; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.