Black Screen – Both a terminal emulator and an interactive shell
github.com
github.com
Unfortunately, in practice it falls short. RAM is one thing, but CPU usage is absolutely through the roof. The app freezes when trying to type "cd jobs", then consumes all CPU cores fully and stalls my computer. Fans spin up and doing a simple "ls -al" takes several seconds for it to complete. During this time it will not buffer keypresses properly and I experienced old keypresses being mixed with new ones, to create a command I did not type.
The project doesn't sell itself as experimentation. Even if it did I'd advice against testing it, simply because of the severity of the issues I encountered using it for 5 minutes.
This project shows what can be done. It's a step forward. Now it's up to other terminal emulators to see how far they can go towards this.
> Also, unlike most of the emulators you can meet nowadays it uses HTML and CSS for its UI (exactly as Atom does), which means we can stop misusing unicode characters and make a better looking terminal with appropriate tools.
I added emphasis.
When they say it's the right tool for the job, and in reality it's not... well, you get reactions like these. And justifiably I think.
* a popup menu * colored background lines * another popup menu
well that's not exactly innovative (a popup menu for argument completion is available in fish today without eating RAM like Chrome)
- I'd say I need to look up any option flags or commands I use less than 15x/week
- Even the most professional 10x developer will spend a significant amount of his time with such commands, making this feedback useful
- The shell is essentially a REPL, but most people forgo most of its potential because the language isn't core to our work, and somewhat hideous. Anything that helps discoverability could be useful.
And, for what it's worth, designers that work with code usually don't have problems with git. Designers that work with photoshop would rarely need git, which is kinda out of its element with binary data
I think you know just as well as everyone else that this project's use of Electron is unlikely to be an interim measure. It will (probably) always be a resource hog, just like Chrome will (probably) always be a resource hog. That's a conscious choice that is here for the duration.
Using Electron may have accelerated the process but let's not pretend that the author is going to rewrite it in something more performant once a little traction is gained.
1. continue using it despite the footprint
2. merge similar ideas into other emulators
3. fork and rewrite in whatever the next paradigm for expressive UI apps is (with hopefully a smaller footprint)If people don't want to use Electron apps then don't, but don't fill every single discussion of an Electron app with the same old whining.
My mistake, then.
Either way, it's nice to have options, and it's nice to see innovation, and if Electron makes it easier to innovate we should be glad of that.
Okay that was a bit snarky, but.. aside from the primitive monkey part of my brain that cringes at any electron app's resource (ab)use, there's the fact that these apps are proliferating like crazy, and the resource usage adds up after a while.
If all you're running is Atom, you probably don't care. But when you're using Atom, Simplenote, Discord, Slack, Nylas, and Brave all on the same box at the same time (hi!), it's enough to bring even a modern desktop processor to its knees when any of them misbehave. With Moore's law on its way to being broken, I'd like to see tighter development, rather than this sprawl of easy-but-wasteful tools.
Electron is to app development as Keurig machines are to coffee. Easy, convenient, horribly wasteful and inefficient.
If we also dont pretend that the sort of people complaining are anything but a distraction.
Because nothing is stopping them from writing something they like better, except off course skill, attitude and discipline. Thankfully they are able to contribute something much more valuable: opinions.
So, yeah. Maybe its a resource hog. Its still interesting and far superior to resource friendly version with the same feature set due to it having the awesome feature of actually existing.
If people don't want feedback, then they shouldn't post on HN. HN is a place where plenty of people provide opinions whether others like it or not. If that's not something people want, then they shouldn't be here.
As for making something better. Better solutions already exist. Terminal emulators are an already solved problem. What terminal emulator problem will be solved that hasn't already been solved by urxvt, KiTTY, Serial, or any of the other Electron based terminals like Magnesium or Hyper?
That's not to say people shouldn't try as there are many reasons to do so. To suggest that opinions are somehow less valuable than yet another implementation of a terminal emulator written in a bloated framework based on a language that was designed in 11 days just to animate web page elements - and that people should reinvent the wheel or shut up... well that's just like, your opinion, man.
Well if you clicked the link, you would see a number of original features, including html output support. And i don't think it's fair to say that modern javascript is the same language as the one Brandon Eich designed in 11 days.
But if you think that constitutes 'feedback' -- that wouldn't be my definition.
>If people don't want feedback, then they shouldn't post on HN.
Which is what i generally suggest people do -- not because they don't want feedback, but because most people would simply lose motivation when the majority of people react to the glimmer of the word 'electron' and don't bother to click the link or check out the features.
And you can replace 'electron' with anything really. If somebody writes something in Java, there is a good chance some people will react saying that the JVM is evil or how Java is a horrible enterprise language. If somebody writes something in PHP, they'll get the PHP is a horrible language. If somebody writes something in C, they'll get a 'C is too insecure'. If somebody writes an OS-X app or a Windows app, they'll get feedback about how they picked the wrong OS.
It's feedback in the same way that fat shaming a classical pianist would be feedback. If the same 'feedback' can apply to millions of projects without alteration or requiring any effort to establish whether it's applicable -- that is not feedback, that is just taking the piss on something.
Instead, it's a thread full of people who didn't actually check it out, but abuse the opportunity to repeat a knee-jerk reaction to electron. It's just feels like going to a concert and instead of people talking about whether they liked the music or not, they just default into fat shaming the singer or something to make themselves feel better about themselves.
>So the only feedback that is permissible is adulation?
I guess we differ on what constitutes 'feedback' -- i didn't see much in this thread that would qualify as such.
Screaming fast GPU accelerated screen rendering _is_ a new way of working with the terminal IMO. All hail alacritty. That's the kind of innovation I support. Trying to max out RAM and CPU for a slightly better looking UI is not something I am even going to consider trying out.
Also, speed and resource useage is a valid concern. Some comments say that it's practically unusable on modern hardware, and on my laptop which is 7-8 years old, I can't touch this when it comes for linux (non that I would, but) because Electron is just too heavy for my computer, and I'd rather not use it than replace my device.
Tried it again today, replacing urxvt+zsh for an hour or so. Most of these problems are probably due to the fact they use a custom shell:
- ctrl-r (history search) just reloads the electron window and clears everything [0]
- does not work with virtualenv (bin/activate just messes up the shell to the point where even `ls` stops working – `Black Screen: command "ls" not found.`) [1]
- weird tab completion
- none of the "advanced" shell features work over ssh (well, that's expected, since ssh starts a standard bash/zsh/whatever shell on the server)
- had to install bunch of additional npm deps [2] to make it start on Linux
- `tmux` is less broken that it used to be when i first tried it, but still not without any problems, same for `htop` and `vim`
- it reports that some built-in commands are present, but they don't work at all (eg. print, source) [3]
Plus it's kinda slow. Terminals are hard.
[0] https://github.com/vshatskyi/black-screen/issues/260
[1] https://github.com/vshatskyi/black-screen/issues/94
[2] `npm install fs-vacuum init-package-json npm-install-checks npm-registry-client read-installed`
- jump to previous commands.
You just ran a command that printed a few pages, you want to scan from the first line. You have to scroll up and find the last prompt, where you typed the command. Why isn't there a shortcut for this?
- collapse previous outputs (stderr / stdout / both)
Hmmm, were there any warnings in the build I just ran? Anything on stderr? Let me toggle stdout / stderr after the command has been run.
- connect a pipe to a previously run command
You run a computation that takes a minute and produces a few pages of output. You realize you want the output sorted. So you run it again. You could pipe to sort, or if you piped to a file you could cat the file next time you needed the output. But why can't you re-use the output that is there in the terminals scrollback buffer?
macOS's Terminal.app has this. Key shortcuts can jump between prompts (or between marked lines if you want to press a key combo to mark arbitrary lines), and can also select all text to the previous/next prompt (so you can trivially copy the output of a command).
> Hmmm, were there any warnings in the build I just ran? Anything on stderr? Let me toggle stdout / stderr after the command has been run.
Potentially interesting, but I'm not sure if it can actually be done. Both stdout and stderr are connected to the pty; can the pty meaningfully distinguish which connection is stdout and which is stderr? Also, what happens if stdout and stderr get mixed in the same line? You can't really collapse that.
>- jump to previous commands.
>You just ran a command that printed a few pages, you want to scan from the first line.
I think tmux might get you there. You bind a key to enter copy-mode and backward search for your particular prompt. >- collapse previous outputs (stderr / stdout / both)
> Let me toggle stdout / stderr after the command has been run.
That sounds like a good one. >- connect a pipe to a previously run command
>... But why can't you re-use the output that is there in the terminals scrollback buffer?
Once again tmux could "save-buffer" to a file for you if you did that backwards search then copy to a paste buffer. Just bind another key.It has a few problems though, like I keep selecting text by mistake. Also, no tab support?
At the end of the day, I think iTerm2 is a good balance between speed and functionality.
Maybe if electron's dependencies could be compiled down to the minimum functionality needed by a given application this could work.
once you add in e.g. tmux for multiplexing and scrollback, then you are bottlenecked at tmux's speeds, as opposed to the terminal emulator's speeds (not like it really matters, but its an interesting effect)
Where will the bottleneck be?
https://www.reddit.com/r/programming/comments/5mflek/alacrit... The Terminology (another light-weight term, with memory goals, that has scrollback) developer's comments are here
It means rendering without the UI from what I understand.
urxvt -pe tabbed
# or
urxvt -pe tabbedex
Tabbedex needs to be installed, it has more features than `tabbed` (which is bundled with rxvt iirc), eg. tab renaming and moving. Looks like this: https://vgy.me/S1j8Re.pngAt least the core developers should provide the default tabbed wrapper on top of it.
But who knows, maybe it will be successful even without tabs.
Or we could write "thumbnail babes.jpg" and it renders it directly in the terminal instead of popping up another window.
Or if I'm wanting to do some scripted image editing it'd be pleasant to be able to render images directly into my terminal as I work out the specifics of my task. As opposed to writing to temp files and then viewing them with a separate viewer.
Personally though what I want from a terminal emulator is something integrating into SSH which creates an out of band channel from the remote end of my ssh session to the terminal emulator. This way I don't have to play stupid games with shell prompts and the like, programs could literally know that a data path to my screen is available and do things like change background colors if I've changed users. Messing around with prompts and shoehorning too much stuff into escape sequences is awkward.
So... Atom, Spotify, Black Screen, Slack & Discord, GitKraken. "Soon" is now.
I can imagine at some point the runtime, being so popular, getting heavily optimized by some stakeholder. I already heard that there are some significant contributions from Microsoft. They had also did the same for node.js.
> and given the choice I'd rather go to zoo than buy more ram
While I generally agree with your comment, I personally like shopping for hardware much more than pitying caged animals.
Well one of the thing I notice despite all the new apps made with electron, none of them opened a category of new type of software which wasn't there before. It is just quickly made chat app, notes app, text editor and so on. So it is not that we need dramatically more native developers but to ask do we need 100 more apps of same type.
Isn't this mostly true for Java already? I certainly recall downloading various applications bundled in .jar's and having them work fine on whatever platform I happened to be using.
I think people moved away from writing end-user apps in Java because they were bloated and slow and had ugly UIs, not because cross-platform development was super hard.
Right now I have 8 terminals open, some tabbed, some not, Sometimes I can have over twice as many. Many of them sit untouched on an Awesome workspace for days ready for me to come back to whenever I need them. This isn't a issue since their memory footprint is almost non-existent on pretty much any machine. Could I get away with this if I had to run an instance of Node + Chromium per terminal window? Is Black Screen one step ahead of me and it'll reuse an already running instance and open up another window? Do I want all my terminal instances to be managed by a single node process? Despite my reservations, still going to give this a go.
On a side note, anyone looking for a slightly more useful shell that is still very lightweight: check out fish: https://github.com/fish-shell/fish-shell
Then someone will come up with ElectronOS.
Unfortunately some people seem to have missed that this talk was labeled "comedy" and "absurdist", are actually trying to implement a JavaScript kernel. The talk just got the name wrong - it was "Electron", not "Metal".
I know it's an experimental project, but that's exactly the time to learn Ruby+Tk, or {anything}+Qt, or any of the other cross-platform toolkits. If you have to bundle an entire GUI server ("the browser") with your app to shoehorn HTML into use cases it wasn't designed for, you're doing it wrong.
"wrong" is subjective here. You could also argue that Ruby+Tk is "wrong" because Ruby is not as efficient as coding in C++, or C, or Assembly.
What we're talking about here, (and every time this comes up, again, and again, and again, over and over) is what shortcuts you're willing to take to get to MVP. There are a lot of Electron success stories out there, and when you're a solo dev starting out, and want to make a cross platform app, Electron is approachable and proven.
Question is how much memory would actually be saved.
However, is considerably slower than iTerm2, which may or may not be a problem, and might be solved in future versions.
The deal breaker for me to use this version is that tab reordering doesn't work (doesn't work in Hyper, either).
It would be nice to be able to change the font size.
The real question I have is: why must we use Electron to create good-looking software? Can't iTerm2's UI be improved and be made to look like Back Screen or Hyper?
Why is a terminal emulator slow at all? Why aren't they subject to the same "give me 60hz or die" prejudice as games?
I wonder if someone should setup benchmarks against an actual Wyse green-screen terminal.
Autocomplete by default is also very nice.
Look & feel is not just colors, but a lot of small details that make the UI look good and polished.
chsh
Now you have those completions, documented and all, in all your terminals, whether it's Konsole, Gnome-Terminal, St, Terminator or the linux tty.
I don't use it because '&&' is not available. I use it pretty often.
command1; and command2
More info: https://fishshell.com/docs/current/tutorial.html#tut_combine...; executes the following command even if the first one fails. && only if the previous command returns 0.
So you can do things like: runthiscommand; and echo "Success"; or echo "Failed"
Oh but it is! Read the link!
My two pence; A consolidated push of a React Native for Desktop seems like it could really help here. You get a lot of the benefits of working in a web-like environment (the developer experience, the development speed, the ability to share code across runtimes) but you end up with Native Code (Swift, C#, Cpp, etc.) for each supported OS. RN for Mobile OSs has done wonders in my opinion. I think a real push for RN in the Desktop could be the next big thing for desktop apps.
Electron is popular because it uses regular web tech to build apps. Electron is slow because it uses regular web tech to build apps.
Where is the compromise?
Another question is "popular with who"..
> the developer experience, the development speed, the ability to share code across runtimes
I don't know what you mean by "the developer experience", but surely any high-level language gets you speedy development, and architectural agnosticism?
The typical hacker news user probably isn't going to love this. It's certainly not as performant, and probably a slower workflow if you're someone that prefers to never let your hands leave the keyboard.
That being said, it's definitely not ready for full time. I ended up switching back to terminal for now, but I keep watching this closely.
Um? If you like native apps you probably despise anything Electron.
Main stated motivations appear to be "better looking" and autocompletion, which doesn't really sell it to me.
Btw, there is another electron-based popular emulator called hyper[1].
At work, I use a VT100 cartridge for my Atari ST. It's not entirely VT100-compatible but I know for a fact that the vast majority of ncurses applications (not even to mention tmux) don't work and cause the terminal to be so corrupted as to be unusable.
Many applications rely on specific behaviours of newer terminals, so a better target would be xterm (or similar) compatibility. No one is targeting VT100 anymore.
Incidentally, the Apple glyph (, or ⌥⇧K on macOS), is actually in the PUA as well (in fact, it's the very last PUA codepoint, U+F8FF). Which is why it may not render correctly in fonts that don't ship on macOS. Anyone reading this on Windows, Linux, or Android probably won't actually see the apple character.
If your browser could not draw the tub and pantheon above chances are neither would black-screen. The author seems to be an accomplished coder, but I can't see how the magic of JavaScript will make teaching your font engine how to paint a glyph go away.
And that's where I closed the page. Though the ideas are nice.
Electron is a memory-hog and I see how the trade-offs it does wouldn't suit an application which is likely to keep running in the background with multiple instances, and stating that would be much more constructive IMHO.
Let's hope author/poster doesn't close the HN tab immediately after seeing your comment :)
Who these "us" you are referring to?
As the old saying went back in Fido/BBS times - "unlearn to speak for everyone".
"Us", here, refers to the HN readers.
> As the old saying went back in Fido/BBS times - "unlearn to speak for everyone".
I didn't say that we all thank the author. In that sentence, the person who is thanking is me, let alone the whole thing being a figure of speech.
But I really don't see much potential in Electron for any kind of heavy app. And even if it was acceptable, I'd still prefer it to be native.
Well, what I implied was: I don't think this will go anywhere as long as its tied to Electron.
It might be OK for exploration of the UX space, but not for any kind of practical everyday terminal replacement (and I've used the one in VS Code).
Also, if it's that obvious, why are there many people up-voting this and even then, why would you keep stating the "obvious"? Do you think the scenario you described, written as a "how to blend..." article, would attract attention here?
Just because something is obvious, doesn't mean people also consider it obvious.
So, one reason to "keep stating the obvious" is to inform those people.
A blender that emitted harmful radiation would be unsuitable for anything too.
Electron is to semi-technical+ users as Beats headphones are to audiophiles.
I think it is a blender that does same thing what most other blenders do but consumes 10 times more power. However it comes in 100s of colors so cool people like this innovative product.
It also appears to take over lots of the autocomplete/history functions from BASH, which also means it will either not play nice with ZSH or carry over that functionality when used with ZSH.
Going over the screenshots there also appear to be a bunch of hand populated options/descriptions(unless it's auto filling based on man) which would take away a lot of the modularity.
Also, it appears to be coded in Node and the Read Me mentions Visual Studio, and REE M$ and all that comes in.
Why would I run a terminal app which drains my Macbook battery three times as fast as the default app?