Live data from Hacker News

Black Screen: A modern terminal emulator based on Electron

github.com

51–60 of 97 posts

Re: Black Screen: A modern terminal emulator based on Electron

#51

One of these seems to pop up every few months, which is great, terminals are old crusty awful things, but it seems like they always die out in development before they can run existing things like Vim which makes them fun POC's and not much else :/

The problem seems to be that they come at things from the wrong direction - you can't run vim without being backwards compatible with at minimum terminfo pages, very likely vim also makes an assumption also that the terminal communicates over a tty, and possibly you may just need to support actual ANSI Escape Codes. You can't run anything else without that either. Running vim should be the first thing this terminal can do.

Just like the web itself, any new teminal client needs to be backwards compatible with the capabilities of prior terminal clients, because programs that run in the terminal expect it. And if your terminal can't run the programs everyone runs in their terminals, no one will adopt your terminal. But many of these projects seem to have no intention of maintaining that backward compatibility. Some, like TermKit, fully conflate the terminal and the shell and even many UNIX utilities.

You can't hope to supplant ANSI compatible terminals when you let them have the enormous advantage of running all the software anyone wants to run in a terminal that already exists. It would be like saying you have a new, better web browser that can't open any existing web pages.

No idea if this particular project has learned from past examples and is backwards compatible or not. (EDIT: It doesn't have a terminfo page, so probably not.)

Re: Black Screen: A modern terminal emulator based on Electron

#52

Earlier quoted context omitted.

cat tmp.png "Yep that looks like it's right" git add tmp.png

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

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

#53
post #9

Earlier quoted context omitted.

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…

iTerm 2 actually supports images! 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-wit...

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

Re: Black Screen: A modern terminal emulator based on Electron

#56

One of these seems to pop up every few months, which is great, terminals are old crusty awful things, but it seems like they always die out in development before they can run existing things like Vim which makes them fun POC's and not much else :/

The problem seems to be that they come at things from the wrong direction - you can't run vim without being backwards compatible with at minimum terminfo pages, very likely vim also makes an assumption also that the terminal communicates over a tty, and possibly you may just need to support actual ANSI Escape Codes. You can't run anything else without that either. Running vim should be the first thing this terminal c…

It does indeed support ANSI codes. Not fully compatible with VT100 yet, but that's where I'm moving. Vim is functioning, but there are a lot of bugs. https://dl.dropboxusercontent.com/spa/dlqheu39w0arg9q/xxy316...

The problem with terminfo is that not every tool relies on it. I've seen many examples (hello, exa), when the codes are hard-coded to operate with xterm-256. So, I decided to pretend to be an xterm.

Re: Black Screen: A modern terminal emulator based on Electron

#57
post #54

Bringing up a whole web browser engine for the terminal is a deal breaker for me. I want it to start instantly. 1 second is too long.

That's understandable. It's like with editors. There is vim and there is Intellij IDEA (sorry, JetBrains, for calling your child an editor). I want it to be smart.

Re: Black Screen: A modern terminal emulator based on Electron

#58
post #10
post #3

Bummer. Doesn't compile with iojs.

It looks like it uses "child_pty" to spawn pty's. child_pty hasn't been updated to support the latest nan/v8 api (in fact, it looks like it's been unmaintained since March). It also improperly uses fs streams to read and write to the pty fd which will exhaust the thread pool very quickly. So, even if you can compile it, it will still break. It also looks like it doesn't handle sigchld with a waitpid anywhere, so be p…

Thank you for the advice. Pty.js was my initial choice, but it didn't support return codes at the moment. I'll take a look at it again.

Re: Black Screen: A modern terminal emulator based on Electron

#59

I kind of don't want to have my terminal emulator run a complete webbrowser because that's how all the cool kids now pull off the Delphi window skinning look of 2000.

I think that what these JS-based UI toolkits are doing is really great, but I really dislike the idea of bundling basically a browser with the application.

There is a positive side: a built-in HTML and CSS engine allows to write very customizable interfaces.

Re: Black Screen: A modern terminal emulator based on Electron

#60

Hello. I'm the author of Black Screen, and I'm upset this post has appeared on Hacker News. The terminal is at a very early stage; I don't even use it by myself. Although, it's nice to see that people show some interest.

You should probably put a note saying as much at the top of the README.

Pretty cool looking project though, I have been thinking about something like this for a while now. The two biggest problems seem to be performance(I spawn throwaway shells all the time, so my terminal emulator need to open pretty much instantly), and fully compatibility(I use vim in the terminal as my main editor).

I'll be watching to see how it turns out.

Post reply on HN