diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 6a41daff2..0733c64c0 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -35,7 +35,7 @@ jobs: uses: github/codeql-action/analyze@v2 - name: run fastfetch - run: ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true --load-config presets/all + run: ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true --load-config presets/all --disable-stdout-buffer - name: run flashfetch run: ./flashfetch @@ -81,7 +81,7 @@ jobs: uses: github/codeql-action/analyze@v2 - name: run fastfetch - run: ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true --load-config presets/all + run: ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true --load-config presets/all --disable-stdout-buffer - name: run flashfetch run: ./flashfetch @@ -113,7 +113,7 @@ jobs: run: | cmake -DSET_TWEAK=Off -DBUILD_TESTS=On . cmake --build . --target package - ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true --load-config presets/all + ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true --load-config presets/all --disable-stdout-buffer ./flashfetch ctest @@ -180,7 +180,7 @@ jobs: run: cp /clang64/bin/{libcjson,libOpenCL,vulkan-1}.dll . - name: run fastfetch - run: ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true --load-config presets/all + run: ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true --load-config presets/all --disable-stdout-buffer - name: run flashfetch run: ./flashfetch diff --git a/completions/bash b/completions/bash index 8a3ef9e0c..6b6e4e574 100644 --- a/completions/bash +++ b/completions/bash @@ -175,6 +175,7 @@ __fastfetch_completion() "--logo-print-remaining" "--multithreading" "--allow-slow-operations" + "--disable-stdout-buffer" "--disable-linewrap" "--hide-cursor" "--cpu-temp" diff --git a/src/data/config_user.txt b/src/data/config_user.txt index e588557b2..a2430cff9 100644 --- a/src/data/config_user.txt +++ b/src/data/config_user.txt @@ -33,6 +33,12 @@ # Default is true. #--multithreading true +# Disable stdout buffer option: +# Sets if fastfetch should disable application buffer of stdout. Mainly for debugging purpose. +# Must be true or false. +# Default is false. +#--disable-stdout-buffer false + # Slow operations option: # Sets if fastfetch is allowed to use known slow operations to detect more / better values. # Must be true or false. diff --git a/src/data/help.txt b/src/data/help.txt index ed25dcb11..948f88dcc 100644 --- a/src/data/help.txt +++ b/src/data/help.txt @@ -19,6 +19,7 @@ General options: --load-config : load a config file or a preset (+) --multithreading : use multiple threads to detect values --allow-slow-operations : allow operations that are usually very slow for more detailed output + --disable-stdout-buffer : disable stdout application buffer --escape-bedrock : on bedrock linux, sets if it should escape the bedrock jail or not --pipe : disable logo and all escape sequences diff --git a/src/fastfetch.c b/src/fastfetch.c index f0815cae4..356b94b88 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -909,6 +909,11 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con instance->config.multithreading = optionParseBoolean(value); else if(strcasecmp(key, "--allow-slow-operations") == 0) instance->config.allowSlowOperations = optionParseBoolean(value); + else if(strcasecmp(key, "--disable-stdout-buffer") == 0) + { + if(optionParseBoolean(value)) + setvbuf(stdout, NULL, _IONBF, 0); + } else if(strcasecmp(key, "--escape-bedrock") == 0) instance->config.escapeBedrock = optionParseBoolean(value); else if(strcasecmp(key, "--pipe") == 0)