Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please add browsing images #29

Open
letarg0 opened this issue Jan 16, 2019 · 5 comments
Open

please add browsing images #29

letarg0 opened this issue Jan 16, 2019 · 5 comments

Comments

@letarg0
Copy link

letarg0 commented Jan 16, 2019

like gqview

@hzeller
Copy link
Owner

hzeller commented Mar 15, 2021

The closest to browsing images is so far the recently added grid mode. With --grid=3 you can for instance arrange images more compactly on the screen. If you add --title you can see the associated filenames.

But it is not interactive. That sounds like something useful: selecting an image and showing an enlarged version in a separate area.

@tombh
Copy link

tombh commented Oct 4, 2021

timg --grid=3 *.jpg|less is almost there, but the scrolling breaks

@hzeller
Copy link
Owner

hzeller commented Oct 4, 2021

interesting. Looke like less can't deal with the grid layout as the output to the terminal writing one image at a time, then jumping back up and to the right and then doing the next image. The -R option sanitizes the cursor jumps away.

The default behavior is useful for regular terminal output in which we want images to show as soon as they are loaded, but maybe it would make sense in the cases of output not being a terminal to render each row first then output.

Note, for anyone reading this: to make less work at all with timg, you'd need the -R option to output raw escape sequences. (it sanitizes to not include cursor jump commands, so grid will shown one after another):

timg --grid=3 *.jpg | less -R

The lowercase -r option also outputs cursor jump commands and would actually allow to show the grid output, but then scrolling up will break

timg --grid=3 *.jpg | less -r

@xeruf
Copy link

xeruf commented Nov 29, 2021

In kitty, less -R only displays text while less -r displays the images but allows no scrollback :/

@Sonico98
Copy link

How about implementing hyperlink support, like how coreutils ls does? That way it would be possible to use the already existing grid functionality, and each file would be clickeable. The only requirement would be to use a terminal that supports hyperlinks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants