Open HimeLexie opened 1 month ago
I investigated the cause of these issues:
distros
code generation placing the ascii art in raw strings that have the triple quotes on separate lines from the art, resulting in guaranteed leading and ending newlines, which end up padding the art on top and bottom. Unfortnately the proportionally distributed stripe coloring stretches over those invisible blank lines. The distribution could lead to the first and or last colors not being shown. Therefore, this should be fixed by stripping out the extraneous newlines. Can fix by appending [1:-1]
slice operation to the ascii art string expression. (See third paragraph of rust-malaysia/hyfetch/pull/30 )\n
before proceeding with for further processing. Such an iterator (from splitlines()
etc) generally does not consider the file's final newline to be starting a line. That would also ensure correctness for Windows \r\n
line ending ascii art files.The Rust rewrite (#317) that is almost completed, and it does not have the first issue. However it still has the second issue, so I will send a PR to the fork to fix it there. Even though I recently found the first issue, the second one could have gone unnoticed for quite a while without your report. Thanks for taking the time here! š
This issue can be mitigated by copying the ascii art to a file (unescape backslashes), using the --ascii-file
argument, and making sure that file does not have a trailing newline. Text editors often try to enforce that it is there. Inspect the ascii art file with xxd
and remove the last byte (if it is a newline) with truncate -s -1 <file>
. Then since a custom ascii file is not specifiable in the config.json
, instead setup a shell alias.
@HimeLexie Can you help us test if https://github.com/hykilpikonna/hyfetch/pull/317 works correctly for you now?
@teohhanhui Do i just clone the riir branch?
@HimeLexie Yes, quick way (for development): cargo run
(you need to install rustup
first: https://rustup.rs/)
Or to install it locally (example on Linux):
cargo build --release
cp target/release/hyfetch ~/.local/bin/
Can confirm its fixed, thanks a lot! I was wanting to use this but the weird formatting was frustrating.
And for the custom ascii file as well? :smile:
You can do e.g. cargo run -- --ascii-file ...
Appears like it does.
Describe the bug
When using the flag --ascii-file (file) without leaving a leading new line above the ASCII art in the file, colors will misalign (see picture below)
Expected behavior
first, i expect that the hyfetch ASCII art should display as neofetch does without an extra space above it and work (see picture).
second, i expect that colors should realign correctly for custom ASCII files (see images below, highlighted to show colors).
Screenshots
Color misalignment without new line: Hyfetch prints extra line above ASCII art compared to neofetch:
showing color misalignment with highlighting to make colors easier to see:
Please paste the content of
~/.config/hyfetch.json
below:Additional context
I have seen the extra new line in other screenshots of hyfetch on other issues.