Hey all, ET developer here. It was an amazing surprise to find ET on the top of HN today. Since it's the three year anniversary of the project, I wanted to share a post that I wrote to my colleagues about it:
RejoinableTCP was a project that I started and abandoned in 11/18/16. RejoinableTCP was supposed to be a remote shell that automatically reconnects without interrupting the session. It was supposed to be resumable like mosh but with the user experience of ssh. I never started it, because:
1. Unix sockets, public-key encryption, and how TCP actually works are the stuff of eldritch nightmares.
2. No one would switch from ssh just to save a few minutes each day. No one would switch from mosh just to get OS scrollbars
3. I wasn't living up to my expectations in my day-job, and it was taking all of my time. There was no way that I would work on something new.
I created an empty folder and gave up on the same day. The next day, after using mosh for a few hours, I decided:
1. I would give myself three weeks to learn these things before truly giving up.
2. Even if no one else used it, I'd use it.
3. I'd keep a weekly log of time spent and economize that time.
4. RejoinableTCP was not a good name.
So on 11/19/16 Eternal Terminal was born, and three years later, here we are.
Somewhere out there, there is some engineer today who has an idea in the same state that I was with Eternal Terminal three years ago. This post is for you:
1. You can prototype anything in three weeks if you put your heart in it.
2. Look around: all the engineers around you felt that same Calling, when you are building something amazing, time becomes fluid and things just flow. We may all come from different places and backgrounds, but that shared experience unites us. If you see a way to make this place better for you, it will probably make it better for others as well.
3. If you love the job you do and the place you work, you can find a way through almost any situation. The entire company is rigged in your favor.
This really resonates with me because it was a very similar story with one of my projects (a $SHELL -- a bit like Bash et al). I started it as a short "what if" project and was really surprised at just how much already worked after only 3 weeks.
I think it's a great lesson for hobbyists: don't worry about perfection. Just POC something and if you're still passionate about it after 3 weeks you can always go back and tidy stuff up.
Since I often complain about bad landing pages, I want to take a moment to highlight a really good one. I arrive on the page and:
BOOM! "Eternal Terminal" the name of the project
But what is-- "H2: Remote terminal for the busy and impatient"!
In a sentence or two? "Eternal Terminal (ET) is a remote shell that automatically reconnects without interrupting the session. Learn how to install and use it here."
Oh sweet, now I know what this is. But I'm a power user, can't you also just do this in bash using-- "Here are alternative approaches along with explanations of why we're better"
Cool stuff, is this a new thing or-- "Here's our paginated version history with DATES! BEAUTIFUL WONDERFUL RELEASE DATES so you can see quickly that this project is at least a couple years old."
Sure sure, but what if someone on HN had just linked to the most recent release notes? "Let your eye and your mouse cursor drift naturally to the upper left hand corner, where the name of the project shows up and links to the landing page you just spent 5 minutes gushing about."
Actually, I found the homepage (landing page) not so great, and came here to the comments, in the hope to get some more information. Specifically, I use Mosh, and I would like to know, is this the same thing? If yes, how is it different? What are advantages/disadvantages? I would have wanted a more detailed comparison. The name is also a bit confusing; just from the name, I thought this might be a terminal emulator.
Back to Mosh: If it supports scrolling, how does that work? Is there also a prediction engine like in Mosh? What about ncurses apps? I skimmed briefly through the "how it works" page now, and it seems it also uses TCP instead of UDP. Shouldn't UDP be a better protocol for such a tool (also, that's what Mosh uses)? That page also does not say anything about how the prediction works (which is important in Mosh for the low latency), or whether it even does that (or how else could it have low latency)?
At least one of your questions is answered above the fold of the homepage.
mosh: Mosh is a popular alternative to ET. While mosh provides the same core funtionality as ET, it does not support native scrolling nor tmux control mode (tmux -CC).
My understanding is: Mosh can't scroll because it doesn't send you the full output of the terminal. It only sends you the current "window" (visible terminal contents) at the current time. ET sends you everything.
So if a program suddenly outputs a massive number of lines, mosh will discard the beginning and only send you the visible end of the output. ET will send you everything - which might bog down slow connections, but provides natural scrollback.
It appears that it just creates encrypted stream connection, ensuring that no data is lost when TCP reconnects.
So scrolling/all terminal functions works as with normal SSH.
Contrary to Mosh, which emulates its own terminal, synces whole screen so it doesn't clog with runaway output, works with high packet loss and have local typing prediction.
mosh by default doesn't support native scrollback. The way mosh is implemented (by default at least) is to just paint the screen locally with the remote "view".
If you try to scroll back in your terminal locally (literally scroll up with a mouse/trackpad), it will scroll up your local terminal instead of scrolling up in the remote view. So your scrollback is literally capped at the vertical height of your local terminal window.
This is super annoying if you want to see long output of a previous command or even see what the output was of the command you ran five minutes ago.
ET solves this by basically doing ssh under the hood. So you have real scrollback by default. It's REALLY nice and is one of the primary reasons I use ET.
---
As far as tmux control mode, in essence, it allows you to control tmux via your native terminal commands. On iTerm for example, you can use the key command to vertically split the (iTerm) terminal and tmux will actually hijack that command it do it in tmux. So you can use your native terminal multiplexing commands instead of the tmux key commands.
I only know of iTerm 2 that supports this functionality, just as a heads up.
Not being able to scroll was a pain, but nothing that tmux or even output piped to less couldn't solve. It wasn't glorious, but it worked. That said, might be tempted to try ET just because scrolling through long winded outputs are a frequent thing.
Smooth-scrolling back through a command that unexpectedly dumped 500 lines of output, using Alacritty and a big scrolling trackball with acceleration, is pretty glorious.
Hey George, the wiki is good, as is the whole tmux/iTerm integration. You might want to add a section on reconnecting to ssh agent forwarding from Mac (the whole `eval $(tmux showenv -s SSH_AUTH_SOCK)` thing).
Run some command that outputs more than one page of text and try to scroll back in your terminal emulator. You won't see the remainder of the output, while with ordinary ssh and eternal terminal you will.
At the risk of incurring self promotion issues (and I really don't understand what qualifies as acceptable self promotion), I didn't feel that this article was all that clear if you are an AWS focused user, so I wrote up all the steps it took to use Eternal Terminal in an OSX / AWS context including an Ansible playbook for configuration.
This is a good landing page. Every open source project should have something like this.
And this is how you create useful software. Looking for something to work? Try solving a problem you have. This is a so basic feature and so useful too.
I asked my self the same question, scanned the linked article and did not find any matches for "screen". So please, could you tell me in short, what the benefit is?
They are a bit orthogonal. When you have a flaky connection, screen will help keeping your stuff alive on the remote host but you still need to reconnect all the time the connection drops. ET and mosh will make it look like your connection never dropped.
This article didn't help with screen, but it convinced me that eternal terminal isn't what I want because I often leverage mosh over poor connections and I generally use tmux anyway.
My first question I couldn't find answered easily is "How does it work", e.g. "How does it maintain the connection?
The answer so far is that it does require you to install ET on the server too, along with the client. And then I searched github for "multiplex" thinking maybe it uses TCP multiplexing. And found a branch named "multiplex". Then I realized the Linux feature I was thinking of is actually called TCP Multipath, searched for it and no go. So I can only say that it _seems_ that it is _not_ using TCP Multipath for maintaining the connection over multiple connection drops.
I'm glad that it has tmux compatibility. Does anyone else have a love hate relationship with tmux? I hate its scrolling and buffer behavior, its almost impossible to get right. Been waiting for a good replacement for tmux to come along for a while now that isn't just i3. Right now I just use tabs in the terminal app most of the time because I dont want to mess with mouse mode, etc.
> Been waiting for a good replacement for tmux to come along for a while now that isn't just i3
> Does anyone else have a love hate relationship with tmux?
> I hate its scrolling and buffer behavior, its almost impossible to get right.
I wasn't planning on sharing my project on HN until I've written up more documentation, but I'm actually working on exactly this problem.
So far I've got i3-like controls, resizing & scrolling terminal splits with the mouse, and better color support than tmux.
My current roadblock has been lack of motivation, but if *anyone& on HN finds this interesting (or even just files a bug report), I'd be motivated to reignite my work on the project.
Funny, me too! I was adding some features yesterday, a few more today, but I took a few minutes to do screenshots and join the discussion.
If you are focused on better controls, our work may be complementary. Would you like to join forces on a high quality fork? A few things concern me with tmux currently.
https://github.com/tmux/tmux/issues/1613 is a better reflection of my views on SIXEL, although I am coming round to the idea rather. It is not easy to do properly however, I am interested to see how your code works.
I don't have zsh setup on the OS I'm running currently, but a simple example is that the light-grey autocomplete text from zsh/oh-my-zsh shows up on i3-tmux but not tmux (at least at the time of writing).
I honestly don't remember the exact details, and maybe it's now fixed.
> Does anyone else have a love hate relationship with tmux?
Absolutely. Just today I logged in on some server and started a tmux session to learn that copypasting with mouse didn't work. After googling how to solve this I noticed that scrollback with mousehweel also didn't work. Then I remembered that I did solve that some time ago but never was satisfied with it because the scroll speed/differential was so low.
It is easy to change the scroll speed in tmux, although the default is 5 lines at a time which seems like it should be fast enough...
Mouse and scrollback and clipboard are some of the more complicated areas of terminal emulators and ones where applications like tmux have the least power so they will always have the potential to be a bit fiddly.
I do. I have found yesterday and today several strange issues, and a pattern of breaking more things with new features - like deciding to silently drop lines.
I use mosh to connect up to a raspberry pi over a slow satellite link. For that, mosh works awesome but I’ve always missed the ability to scroll output when I’m trying to debug something. I’m anxious to give this terminal a try and see how it performs in comparison
You can use emacs and tramp to edit files remotely within a local buffer. If you lose connection it doesn't matter, you still have the file, and when you save it auto connects. I often use this with Python and can execute the scripts within emacs with the results being sent back to another buffer.
You can also use eshell or even just shell (if you're not into lisp) within emacs once you are on the remote machine to execute bash commands, with scrolling.
I think that's what is being referred to, but I'm no expert.
> mosh: Mosh is a popular alternative to ET. While mosh provides the same core funtionality as ET, it does not support native scrolling nor tmux control mode (tmux -CC).
I had no idea Mosh did not support tmux control mode. I was hoping to eventually use Mosh more, but not any more.
Glad to see Eternal Terminal works with FreeBSD too.
> Glad to see Eternal Terminal works with FreeBSD too.
Just installed it on my server. Package doesn't include any rc.d service file though. And I am fairly certain that unlike mosh, the Eternal Terminal etserver needs to run as a service, seeing as that is what they do on Linux and on macOS.
I'm gonna open an issue about it on their issue tracker.
Note that the version in FreeBSD ports was a bit out of date and they changed the command-line flags between then and now so I built the most recent version from source and had to make a small change in CMakeLists.txt in order to be able to build it, for which I submitted a separate PR.
If these two PRs are accepted and a new version of Eternal Terminal is released with these changes included then I can ask the FreeBSD package maintainers to update the port and for that rc.d service file to be included in the FreeBSD port and package.
I had used ET For a few weeks and it worked great except for when it didn't. I can't blame ET for sure, but I had some nasty problems with my ET crashing, having to SSH back in and fix ET, and realizing that it blew up my tmux with it. mosh has not caused this to happen :/
Hmmm, I'll give it a try, though I'm quite happy with mosh. Having to open up only one extra port is nice. I use remote tmux sessions, and so I've never had a scrolling issue before.
> Ssh is a great remote terminal program, and in fact ET uses ssh to initialize the connection. The big difference between ET and ssh is that an ET session can survive network outages and IP roaming. With ssh, one must kill the ssh session and reconnect after a network outage
Apart from the reference, they seem to like humour, or at least saying it's "for the busy and impacient" while the name actually means "lasts forever" is funny.
> Is it normal for remote shells to have telemetry?
Well, tools that you wouldn't expect to phone home like text editors and compilers now do. See VSCode, the .NET Core compiler and even the Windows 10 calculator [0].
I personally found that to be a high quality joke. I mean, this isn't Reddit, but I wouldn't stick around a website too long if it were genuinely all business, zero fun.
While this was a joke, I am concerned about terminal utils having (opt-out) telemetry. It seems to have spread recently. For example, Homebrew, .NET core, ...
RejoinableTCP was a project that I started and abandoned in 11/18/16. RejoinableTCP was supposed to be a remote shell that automatically reconnects without interrupting the session. It was supposed to be resumable like mosh but with the user experience of ssh. I never started it, because:
1. Unix sockets, public-key encryption, and how TCP actually works are the stuff of eldritch nightmares.
2. No one would switch from ssh just to save a few minutes each day. No one would switch from mosh just to get OS scrollbars
3. I wasn't living up to my expectations in my day-job, and it was taking all of my time. There was no way that I would work on something new.
I created an empty folder and gave up on the same day. The next day, after using mosh for a few hours, I decided:
1. I would give myself three weeks to learn these things before truly giving up.
2. Even if no one else used it, I'd use it.
3. I'd keep a weekly log of time spent and economize that time.
4. RejoinableTCP was not a good name.
So on 11/19/16 Eternal Terminal was born, and three years later, here we are. Somewhere out there, there is some engineer today who has an idea in the same state that I was with Eternal Terminal three years ago. This post is for you:
1. You can prototype anything in three weeks if you put your heart in it.
2. Look around: all the engineers around you felt that same Calling, when you are building something amazing, time becomes fluid and things just flow. We may all come from different places and backgrounds, but that shared experience unites us. If you see a way to make this place better for you, it will probably make it better for others as well.
3. If you love the job you do and the place you work, you can find a way through almost any situation. The entire company is rigged in your favor.