
Eternal Terminal - ofrzeta
https://eternalterminal.dev/
======
Digitalghost
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.

~~~
hnlmorg
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.

------
Uehreka
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."

Bravo.

~~~
albertzeyer
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)?

~~~
pierrec
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.

Different tradeoffs.

~~~
alexfoo
I'd like something cleverer than that.

Act like mosh but use spare time/capacity to send the historical buffer too.

That way you get the best of both worlds.

~~~
MayeulC
That would be interesting, but also require support from the terminal
emulator. Hence why ET is "native scrolling", I guess?

~~~
OJFord
Oh, so it's actually an 'eternal shell'?

------
math0ne
As a current mosh user i'm interested but I don't know what "support native
scrolling nor tmux control mode" means. Any insight?

~~~
Kilenaitor
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.

~~~
ignoramous
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.

~~~
sjy
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.

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

[https://fuzzyblog.io/blog/aws/2019/11/26/using-eternal-
termi...](https://fuzzyblog.io/blog/aws/2019/11/26/using-eternal-terminal-
with-osx-and-aws-including-ansible-support.html)

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

~~~
anderspitman
I know it's cliche but scratching your own itch really is the way to go. At
least you know your market exists, even if you're the only one in it.

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

Would love a more technical "How" here.

~~~
ElijahLynn
Here it is, I didn't see it hanging out at the top right of the page (#ux
test).

[https://eternalterminal.dev/howitworks/](https://eternalterminal.dev/howitworks/)

------
johntiger1
For someone wondering "how is this different from screen?/ what problem does
it solve?", this article was actually quite nice:

[https://medium.com/@grassfedcode/what-could-be-better-
than-s...](https://medium.com/@grassfedcode/what-could-be-better-than-
ssh-e69561ec1b83)

~~~
Lurkars
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?

~~~
yoz-y
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.

------
donatj
> While mosh provides the same core funtionality as ET, it does not support
> native scrolling

NICE. I love Mosh but have always _ALWAYS_ hated how it messes up native
scrolling.

~~~
mikenew
Mosh also refuses to cut a new release, even after almost two and a half
years. If you want truecolor, for example, you have to build from source.

~~~
shakna
Worth noting that most of the "bleeding edge" package managers will do this
for you already.

Like pacman [0], which you can use on systems like Ubuntu and Debian via
pacapt [1]

[0]
[https://www.archlinux.org/packages/community/x86_64/mosh/](https://www.archlinux.org/packages/community/x86_64/mosh/)

[1] [https://www.ostechnix.com/use-archlinuxs-pacman-package-
mana...](https://www.ostechnix.com/use-archlinuxs-pacman-package-manager-unix-
like-oss/)

~~~
mikenew
I'm not sure what you mean. The Arch Linux package uses 1.3.2, which is from
July 2017.

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

~~~
0xb100db1ade
> 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.

[https://github.com/aaronjanse/i3-tmux](https://github.com/aaronjanse/i3-tmux)

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.

~~~
csdvrx
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.

Please read the following links and tell me whether you share these concerns:
[https://github.com/tmux/tmux/issues/1019#issuecomment-318284...](https://github.com/tmux/tmux/issues/1019#issuecomment-318284445)
[https://github.com/tmux/tmux/issues/1502#issuecomment-429710...](https://github.com/tmux/tmux/issues/1502#issuecomment-429710887)
[https://github.com/tmux/tmux/issues/44#issuecomment-11975530...](https://github.com/tmux/tmux/issues/44#issuecomment-119755304)
[https://github.com/tmux/tmux/issues/1391#issuecomment-403267...](https://github.com/tmux/tmux/issues/1391#issuecomment-403267557)
Please tell me more about your color support issues, and check
[https://github.com/csdvrx/sixel-testsuite](https://github.com/csdvrx/sixel-
testsuite) to see if you can diagnose them more precisely

~~~
0xb100db1ade
> If you are focused on better controls, our work may be complementary.

This is exactly what I'm doing!

> Would you like to join forces on a high quality fork? A few things concern
> me with tmux currently.

I would absolutely love to work together. Please contact the email in my
github profile (@aaronjanse).

I'd be happy to state my feelings on each of those issues, but it seems like
you have done more research than I have.

Would you mind including some of your thoughts in the email you send me?

------
lordleft
Jason, the author of this terminal, has a great podcast about programming with
a cohost called Programming Throwdown.

~~~
unspecified
Thanks for this, I have problems finding good developer podcasts, and at a
quick glance of title + count, this looks promising.

Also...the podcast is more than eight years old!

------
nightbrawler
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

------
tgvaughan
Ever since moving to eshell+tramp, all of these persistence tools, however
beautifully designed, somehow strike me as solving the wrong problem.

~~~
pard68
Could you elaborate on this setup?

~~~
gyrgtyn
First, crash emacs 10 or 12 times...

~~~
totierne2
Emacs daemon,emacsclient,shell mode and -nw ? Works ok if the disconnects are
infrequent once an hour or so.

------
ofrzeta
A downside is that compiling it on CentOS is not so straightforward. I finally
succeeded with activating the devtoolset-8 toolchain.

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

~~~
codetrotter
> 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.

~~~
codetrotter
I created an issue for it and then a PR also.

Issue:
[https://github.com/MisterTea/EternalTerminal/issues/253](https://github.com/MisterTea/EternalTerminal/issues/253)

PR:
[https://github.com/MisterTea/EternalTerminal/pull/255](https://github.com/MisterTea/EternalTerminal/pull/255)

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.

CMakeLists.txt PR:
[https://github.com/MisterTea/EternalTerminal/pull/254](https://github.com/MisterTea/EternalTerminal/pull/254)

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.

------
tudelo
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 :/

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

------
oefrha
Holy shit, it’s mosh with native scrolling? Why haven’t I heard of this?

~~~
Kilenaitor
That's literally the only reason I use it. It's fantastic.

------
heeen2
How does this compare to ssh+gnu screen on the remote host?

~~~
thenewnewguy
Directly from the linked page:

> 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

------
55555
Does this support lag-free typing over slow connections?

------
galacticdessert
I am probably missing the point here, but how is this different than
connecting via ssh and doing tmux attach?

~~~
filleduchaos
That is explicitly and directly addressed in the article.

------
jsilence
Uses one TCP port instead of a UDP port range like mosh makes it easier to use
through a firewall. Nice.

------
desireco42
It is down for me, I wonder if .dev domain is filtered for me? Anyone has
issues accesing this?

~~~
beering
If you ping eternalterminal.dev, does it go straight to localhost? If so, it's
probably your own computer that's redirecting .dev to localhost.

~~~
desireco42
Oh, that explains everything :) I feel so stupid now, thanks.

------
bobowzki
Eterminal.

~~~
mc3
e-Terminal, like it's 1999

~~~
airstrike
I will never give up on writing "e-mail" rather than "email"

------
tekknolagi
Does Eternal Terminal have any telemetry? I guess what I'm asking is, does ET
phone home?

~~~
skyyler
It doesn't appear so.

Is it normal for remote shells to have telemetry?

I hope you were sincerely asking a dumb question and not attempting to make a
low effort joke instead of discussing the project in earnest.

~~~
Nextgrid
> 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].

[0]:
[https://github.com/Microsoft/calculator/issues/148](https://github.com/Microsoft/calculator/issues/148)

~~~
Thorrez
Yes, on the front page of HN right now is a post about Atom phoning home.

[https://news.ycombinator.com/item?id=21642391](https://news.ycombinator.com/item?id=21642391)

