youtube-viewer icon indicating copy to clipboard operation
youtube-viewer copied to clipboard

Height of the terminal is not taken into account

Open ZaxonXP opened this issue 7 years ago • 3 comments

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

ZaxonXP avatar Dec 11 '17 11:12 ZaxonXP

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.

trizen avatar Dec 11 '17 14:12 trizen

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).

ZaxonXP avatar Dec 11 '17 14:12 ZaxonXP

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

dokpm0 avatar Nov 25 '19 22:11 dokpm0