
Notty – a new kind of terminal written in Rust - joshsharp
https://github.com/withoutboats/notty
======
antiquark
Nice idea! Might I suggest using HTML for the escape codes? The terminal would
be basically unlimited if there was a built-in HTML renderer. Maybe you would
need some high level "EnterHtml" and "ExitHtml" functions to simplify your
scripting. But if it was HTML5 compatible, then you could generate canvases
and draw on them, change your font colors, etc.

~~~
tatterdemalion
Hey, author of notty here. :-) This suggestion has been made many times, but
unfortunately I think its not very viable. HTML/CSS simply weren't designed
for the attributes which I think are fundamental to what makes a terminal a
terminal: a character grid with a cursor, controlled over a streaming
protocol.

There is one narrow sense in which its viable - you could have a terminal with
a browser engine and javascript VM embedded inside it, and a command to open
up a browser window and perform HTTP exchanges (either over the tty or through
a TCP connection). This isn't really a new terminal, though, this is just a
new way to open a web browser.

------
tatterdemalion
Hey, I am the author of notty. :-) I didn't see this post until I noticed the
project's star count had jumped up again, but if anyone sees it now and has
any questions please feel free to hit me up.

~~~
vmorgulis

        img  = Base64.strict_encode64(IO.binread('guernica.jpg'))
        mime = Base64.strict_encode64('image/jpeg')
        puts "\x1b_[14;80;16;4##{mime}##{img}\u{9c}"
    

[https://github.com/withoutboats/notty/blob/master/scaffoldin...](https://github.com/withoutboats/notty/blob/master/scaffolding/imagetest.rb)

base64 is a very cool idea!

I hope notty will succeed to define a new text protocol for terminals. We need
that a lot!

------
mikekchar
This looks quite interesting. I wonder, though, if it might be a good idea to
cut back the scope of the project (at least initially). Replacing the ANSI
escape sequences with something sane is a hard enough problem, I think, even
if you were just going for feature parity. Fixing the colour palette problems
would be amazing.

~~~
tatterdemalion
Indeed!

The first step of this project was implementing an ANSI terminal, but with an
eye toward abstracting ANSI commands into more fundamental building blocks, so
that the analogous set of notty commands are already more powerful than ANSI
commands (in the sense that actions that would require multiple ANSI commands
can be performed in 1 notty command). This is done, excepting for bugs (there
are many).

I narrowed down the immediate term goals for radical new features to three:
images, a minimal internal line discipline, and dividing the screen into
multiple grids. I chose these because the first is a clear differentiator and
the other two are very fundamental. Simultaneously, we're working on getting a
reasonable terminal off the ground for dogfooding. Once we have that, the next
step is writing a curses-like library that takes advantage of notty's
features, as well as a shim to run programs written against that library in
non-notty terminals. Then we'll have a solid base for adding more features.

As of right now, it is already an ANSI terminal which accepts a cleaner escape
sequence and supports 24-bit color, barring bugs.

------
openfuture
Terminals are such a mess. All the options on linux are lacking in some way or
have legacy problems......

I hope someone actually finishes one of these 'next gen' terminals that keep
getting abandoned.

~~~
tatterdemalion
> I hope someone actually finishes one of these 'next gen' terminals that keep
> getting abandoned.

I think one thing that hurts other next gen terminals (and indeed, there have
been many!) is that they've tended to change the nature of the terminal in
totally backward incompatible way. They end up being totally new platforms
that are 'terminal inspired,' which means they also need totally new
ecosystems. notty is a much less ambitious pivot. Its just an escape protocol
that, in theory, any terminal could be extended to accept.

------
pmoriarty
The big question is whether you can run vim and emacs under this terminal.
Anyone know?

~~~
creshal
Since it aims to be backwards compatible, you should be able to.

------
mchahn
> Dropdown menus, tooltips, and other features which do not strictly reside in
> the character grid

If it does this then it is heading into GUI application territory. I wonder if
an existing GUI application could be extended to add command-line features to
end up at the same place. Or does such a thing already exist? This might even
be a faster way to get to this goal.

~~~
tatterdemalion
An important distinction the README doesn't really express is that any
features like this are tied to the position of the text cursor inside the
character grid, not to the position of the mouse (though of course they may
accept mouse commands similar to how xterm does). They are GUI-like, but they
are the sort of GUI-like things that programs like vim and emacs already
emulate all the time.

------
ReedJessen
What is loseless keyboard input?

~~~
tatterdemalion
Current terminals do not transmit key releases or presses of modifier keys to
the controlling process.

