o2sh / onefetch

Command-line Git information tool

Home Page:https://onefetch.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 πŸ•Ή

  1. onefetch

Additional context/Screenshots πŸ”¦

Screenshot_20230312_195054

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:
Screenshot 2023-03-18 at 15 04 32
Now:
Screenshot 2023-03-18 at 15 06 07
@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.

Screenshot_20230320_204230

Yeah, it looks better now. I guess I can close this issue.

I realized the logo only works well on dark theme, since the eyes is invisible, but I guess it's fine for now.

I realized the logo only works well on dark theme

onefetch --true-color never for better light terminal compatibility.