News for hackers. Stuff that matters.
Re:Black Screen: A modern terminal emulator based on Electron by userbinator on Saturday September 05, 2015 @09:08PM (#10176523)
Just being able to view images in a terminal would be amazing

What are the advantages of that over using a dedicated image viewer program?

Re:Black Screen: A modern terminal emulator based on Electron by sillysaurus3 on Saturday September 05, 2015 @09:29PM (#10176560)
A different programmer is always more creative than yourself. It's an axiom to remember, because when the people with the power to change the tools at our disposal give us better tools, suddenly we can use them to do things they didn't even realize they wanted.

Even giving the ability to set a specific pixel to a specific rgb value would get far. Yes, some programs would get it wrong or would be annoying to use. But think what it would enable. Even at 3 fps, you could still show the user a performance graph of your program, or a flame chart. In the terminal. No extra windows required, no fiddling with GUI frameworks, just "set some pixels to some values."

In the short term, being able to set text to a specific foreground and background rgb would be nice. I'm talking 24-bit color. It turns out that this is not possible across all Unix variants: OS X default Terminal doesn't support 24-bit color for text. And there's no reason why it should be like that. The standards are in place, and they are a straightfoward extension to exiting behavior. The toolmakers just haven't enabled the other makers to use it. Of course, it's because it makes no sense for Apple to waste engineering cycles on that. But that doesn't change that it would be true that if they gave us better tools, we would do more.

The issue is that it has to be a minimum spec that's supported by all platforms. (All Unix platforms would be fine.) Simply writing a program that supports a nonstandard way of setting pixels to values wouldn't cut it. At least at first. That's probably how it has to start, though, in order for others to follow.

Re:Black Screen: A modern terminal emulator based on Electron by TeMPOraL on Saturday September 05, 2015 @09:51PM (#10176606)
Focus and context. You don't have to switch to another application and, presumably, displayed image will stay in terminal output. It would be great for printing out inline performance graphs, or even sparklines.
Re:Black Screen: A modern terminal emulator based on Electron by anthk on Sunday September 06, 2015 @04:21AM (#10177095)
sxiv .

Combine it with dwm :)

Re:Black Screen: A modern terminal emulator based on Electron by egypturnash on Sunday September 06, 2015 @01:18PM (#10178270)
When you check in something that breaks the build, the tests can drop an image of battered, bloody Doomguy directly into your terminal instead of having to go through something like http://squarism.com/2010/05/23/watchr-unit-tests-growl-doomg....
Re:Black Screen: A modern terminal emulator based on Electron by techdragon on Saturday September 05, 2015 @09:11PM (#10176534)
cat tmp.png

"Yep that looks like it's right"

git add tmp.png

Re:Black Screen: A modern terminal emulator based on Electron by Jach on Saturday September 05, 2015 @10:28PM (#10176663)
Whoopee, 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.
Re:Black Screen: A modern terminal emulator based on Electron by klibertp on Sunday September 06, 2015 @09:55AM (#10177645)
Look 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).

Re:Black Screen: A modern terminal emulator based on Electron by Jach on Sunday September 06, 2015 @04:15PM (#10178859)
Oh, I'm all for interactive development, one of the reasons I prefer dynamic languages is precisely that, I just don't think the utility of having a static (or animated, or auto-reloading ((!) changing output in a non-ncurses shell?!) image in the shell is that useful compared to the engineering effort and what feels to me the loss of the shell's essential character. ncurses is about the limit of having enough control to make a game vs. having something that isn't a shell interface anymore. The shell isn't a monolithic IDE which you only run one instance of, the closest analogy I use is "vim+Linux are my IDE" and terminal windows are just windows to interface with my "IDE" that I can run any time. eom theoretically supports auto image reloading, though other viewers definitely do. When I edit LaTeX files, I do so in vim, and have the PDF open in evince/atril to the side which auto-refreshes when I save the file (if I set up vim to run latexmk on save, otherwise it's just an extra command I do). This is just the same when doing ClojureScript development -- your IDE doesn't necessarily reload and try to support all the features of a browser, the programmer just uses an actual browser to the side and you use whatever IDE or text editor you like and a file monitor manages the auto-reloading stuff.
Re:Black Screen: A modern terminal emulator based on Electron by scintill76 on Saturday September 05, 2015 @11:29PM (#10176747)
For 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.
Re:Black Screen: A modern terminal emulator based on Electron by userbinator on Saturday September 05, 2015 @11:15PM (#10176728)
You may be diappointed to know that Windows' cmd.exe will automatically open the default associated program, so all you need to do is enter the filename if you've associated image files with a default viewer:

http://superuser.com/questions/246825/open-file-from-the-com...

(I suppose a similar thing could be done on *nix with a suitably modified execlp()/execvp().)

Re:Black Screen: A modern terminal emulator based on Electron by geofft on Sunday September 06, 2015 @12:21AM (#10176811)
Freedesktop systems get you an 'xdg-open' command (there's also 'gnome-open' for GNOME, and 'open' for Mac OS X).

On Linux you should be able to wire up binfmt_misc, the plugin system for execve, to xdg-open.

Re:Black Screen: A modern terminal emulator based on Electron by kuschku on Sunday September 06, 2015 @09:46AM (#10177618)
kde-open exists, too ;)
Re:Black Screen: A modern terminal emulator based on Electron by dkns on Sunday September 06, 2015 @01:01PM (#10178194)
If I understand you correctly you can also do this in zsh: https://grml.org/zsh/zsh-lovers.html although not automatically.
Re:Black Screen: A modern terminal emulator based on Electron by nine_k on Saturday September 05, 2015 @09:23PM (#10176548)
This use-case is reasonable, but it still requires a dedicated interface for diffing.
Re:Black Screen: A modern terminal emulator based on Electron by Watabou on Saturday September 05, 2015 @09:49PM (#10176598)
You 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.
Re:Black Screen: A modern terminal emulator based on Electron by garbal on Sunday September 06, 2015 @10:25AM (#10177731)
Lighter faster version of Ipython/Jupyter.