Does not look well on small terminal
pickfire opened this issue Β· comments
Duplicates
- I have searched the existing issues
Current behavior π―
When running onefetch on a small terminal 80x24, it does not seemed to work well.
Expected behavior π€
The image and the stuff should not overflow. Maybe less people use 80x24 nowadays but it is probably not that rare given that quite a few terminals defaults to this size when starting.
Steps to reproduce πΉ
- onefetch
Additional context/Screenshots π¦
Possible Solution π‘
Reduce the ascii image size.
Just checked what neofetch
does, and it looks like it simply cuts off text past the right boundary of the terminal.
\e[?7l
seems to be the relevant escape sequence.
We've already covered this issue in the past #327 and what came out of it is the following CLI flag:
--show-logo <WHEN>
Specify when to show the logo
If set to auto: the logo will be hidden if the terminal's width < 95
[default: always]
[possible values: auto, never, always]
But I agree with @spenserblack, it would be better to programmatically disable the line wrap with print!("\x1B[?7l")
. Unfortunately, last time I tried I failed: #327 (comment)
@o2sh Thanks for the reminder! Should we consider changing the default value of the flag from always to auto? Technically a breaking change, but it should make it less likely that this issue gets raised again.
Wouldn't it be good to as well reduce the logo size?
Wouldn't it be good to as well reduce the logo size?
Like detecting terminal width and shrinking the ASCII art to fit?
Resizing is certainly an interesting idea, but, giving that ASCII art doesn't have many "pixels", I fear that resized ASCII art could quickly become unreadable and/or diverge from the artist's intent. For example, a resizing algorithm would very likely garble the NASA
from Fortran's ASCII art.
Wouldn't it be good to as well reduce the logo size?
One could create a lightweight version of 'onefetch' that emulates the style of pfetch by using smaller ASCII logos and displaying only a selection of info lines.
Should we consider changing the default value of the flag from always to auto?
If we can't find a way to disable the line wrap properly, we may want to try that.
Like detecting terminal width and shrinking the ASCII art to fit? Nope, but just find a smaller logo?
Before:
Now:
@pickfire with #983, onefetch has been updated to automatically disable text wrapping on the terminal before printing its output, and then re-enables it immediately afterwards. Although this may not be the exact solution you were expecting, it ensures that the output remains readable even when the terminal window is small, without changing the output's size.
I realized the logo only works well on dark theme
onefetch --true-color never
for better light terminal compatibility.