5 ms·
I would really love it if one of these web-based terminals managed to stick around. Just being able to view images in a terminal would be amazing. The trouble w
by ibrahima 11y ago
I would really love it if one of these web-based terminals managed to stick around. Just being able to view images in a terminal would be amazing. The trouble with building on web technologies seems to be that the overhead is just too high (eg. Atom) considering how many terminals the average developer has open at a time.
I guess at least since it's based on Electron, it might have more longevity than something built from a cobbled together base. Here's hoping!
- andrewstuart2 11y agoFeh is usually good enough for me. There's always catimg too if you really really want it in the terminal and don't care that it'll look terrible.
- kuschku 11y agoBut still, even with electron, it’s performance will be horrible. Several hundred MB RAM usage for a single Terminal window are just not acceptable. Somehow many devs today write their software under the assumption that a user with 2GB RAM or 4GB RAM will at all times only run one single piece of software.
- steckerbrett 11y agoI liked the JavaScript IRC client which uses like 400MB of memory.
- kuschku 11y agoExactly. And this is somehow acceptable, or even "industry standard" today.
- userbinator 11y agoJust being able to view images in a terminal would be amazing What are the advantages of that over using a dedicated image viewer program?
- techdragon 11y agocat tmp.png "Yep that looks like it's right" git add tmp.png
- nine_k 11y agoThis use-case is reasonable, but it still requires a dedicated interface for diffing.
- Watabou 11y agoYou could just make your own external difftool that displays the two images side by side, and add that in to ~/.gitconfig. Then you could just call that external difftool when comparing images: git difftool --tool img-diff Just an example.
- Jach 11y agoWhoopee, you saved one keystroke (`eom tmp.png` "Yep, looks good. Presses Escape") and if you become interested in any data from previous commands' output you'll have to scroll up more / live with a larger window than otherwise because now you've got an image sucking up n rows in your terminal.
- scintill76 11y agoFor easier use, you could even alias `cat` to run `file` first, then pass to your image viewer or whatever if it's not a text file.
- klibertp 11y agoLook at IPython and DrRacket to see why inline images can be useful in REPLs. With DrRacket you can not only view, but also create and combine images one step at the time, always seeing the latest form of it. And then you naturally end up with a script for doing the transformations needed to get your desired result. In short: the time savings introduced by shortening the feedback loop tend to add up. There is a reason why Web developers now use auto-reloading solutions, despite the fact that it saves "just one keystroke" (F5 in this case).
- willcodeforfoo 11y agoiTerm 2 actually supports images! http://www.iterm2.com/images.html http://www.iterm2.com/images.html It works pretty well. I wrote a little blog post awhile ago about using it for integration testing: http://kevinmarsh.com/2014/05/07/in-terminal-screenshots-with-capybara-and-poltergeist.html http://kevinmarsh.com/2014/05/07/in-terminal-screenshots-wit...
- x0 11y agoThat blog post, very creative. Such a good idea. All I've done with the image integration is show a 128px frown emoji when a script exits wrong.
- Watabou 11y agoYou can view images on iTerm 2: https://db.tt/nO3P7yO6 https://db.tt/nO3P7yO6 And yes, iTerm2 also displays animated gifs.
- dekz 11y agoWhat is displaying your "tabs" at the bottom of your terminal?
- steckerbrett 11y agoThat's part of iTerm. In appearance, set tab style "bottom" and "dark" to emulate that screenshot.
- Watabou 11y agoYep as steckerbrett mentioned, it's the new Dark style tabs introduced in iTerm nightlies, which you can put it in the bottom. It might be included now in the betas or the stable version, not sure.
- jumpwah 11y agourxvt also supports viewing images (or at least I know that because that's the emulator I use, maybe other emulators also support it) Like I know ranger has an option for it, but iirc there's also a way to just run a command ala `cat`ing a text file. If you'd like, I can look into it more if you can't already find out how to do it by searching. Also, people are mentioning feh, I'd like to plug in sxiv (not my program though).
- kaoD 11y agoWow, how? I use urxvt and dindn't know that.
- aidenn0 11y agoThe ranger file manager, which I use can do image previews in urxvt and claims to also work with iTerm, st and xterm.
- jumpwah 11y agoSorry for the late reply. I found it, I got the method from this blog post [1] initally. Also see [2]. However, I'm sad to say that when I tried this again rn, it didn't work anymore. (I know for a fact it used to work great because I used to use it.) The funny thing is, ranger's image preview still works for me (same terminal and everything), so I guess one could start going through the ranger source code to see how they wrap w3mimagedisplay if they really wanted to. I don't really have the motivation for that though because, although I'm a heavy terminal user (and it would be nice), recently switching to emacs means a lot of my file management can be done with dired (an emacs package). And dired can do image previews quite nicely already [3] (I'm assuming provided you're using GUI emacs^). ^^ ^Emacs can fire up terminals inside it anyway, so using GUI emacs is not a problem for me, even though I'm heavily terminal orientated. ^^Although I think I prefer sxiv's thumbnail mode for browsing directories full of images (as opposed to a few here and there). [1]: http://blog.z3bra.org/2014/01/images-in-terminal.html http://blog.z3bra.org/2014/01/images-in-terminal.html [2]: https://github.com/hut/ranger/wiki/Image-Previews https://github.com/hut/ranger/wiki/Image-Previews [3]: https://github.com/ralesi/ranger#screencast https://github.com/ralesi/ranger#screencast
- fanf2 11y agoYou can view images in an xterm, though it relies on X11's lack of partitioning. Xterm sets an environment variable containing its window handle, so child processes can use that to draw in xterm's window. w3m-img (an in-terminal graphical web browser and file viewer) uses this trick.