trizen / youtube-viewer

Lightweight YouTube client for Linux
https://trizenx.blogspot.com/2012/03/gtk-youtube-viewer.html
Artistic License 2.0
1.18k stars 86 forks source link

Height of the terminal is not taken into account #179

Open ZaxonXP opened 6 years ago

ZaxonXP commented 6 years ago

Hi,

I tried to use YouTube-viewer under the terminal and display the comments for the selected video. My terminal displays env variable LINES=33, but the YouTube-viewer shows more comments than it can be displayed in one screen, so I have to scroll up. That is not very convenient. Could youtube-viewer make use of terminal LINES to display content in pages which would fit the screen?

Regards, Piotr

trizen commented 6 years ago

You can try the --results=n option, which will limit the number of results per page.

youtube-viewer --results=5 --comments 'https://www.youtube.com/watch?v=AuA2EAgAegE'

However, this will not guarantee that the comments will fit in one screen. Another approach would be to use the less command, similar to:

youtube-viewer --comments 'https://www.youtube.com/watch?v=AuA2EAgAegE' --no-interactive | less

...but built into youtube-viewer. I think this would work, but I will have to think a little bit about it. Probably I will add it as an option disabled by default.

Thanks for the report.

ZaxonXP commented 6 years ago

Thanks for the hints. It is for sure some workaround. However this paging is affecting all the places (like :h command in interactive session). Nice to have as the option or automatically used reading LINES terminal variable (if present).

dokpm0 commented 4 years ago

Making youtube-viewer's various output functions terminal size aware would be a definite enhancement.