Initially I just wanted to connect to my servers normally. The result is an SSH client with tabs, command history, snippets and its own terminal screen. And at the same time, it became possible to test EvertyUI on a completely different class of applications.
Where did it all start?
I work a lot with servers. I develop EvertyDesk Next, experiment with network protocols, build containers, build applications, sometimes I just go in to see why something stopped working again.
For all this you need SSH.
PuTTY has been available for similar tasks for many years. The program is good, proven, and does its job. But personally, she gradually began to annoy me.
You open one connection, then a second. Somewhere there was a connection error, somewhere the connection was lost. Somewhere you need to remember the command you executed yesterday. Somewhere to deal with the keys again.
And every time there is a feeling that you have to perform too many additional actions around the usual terminal connection.
I don't need a combine harvester. I want to open the application, select a server and work.
And if the connection is broken, it shouldn’t turn into a minor disaster.
At some point I thought: why not write my own SSH client?
Moreover, I already have Rust and my own interface engine EvertyUI.
This is how EvertySSH appeared.
Why write another SSH client at all?
It is clear that there are a huge number of SSH clients.
There are PuTTY, OpenSSH, Termius, MobaXterm, Tabby and many other solutions.
I'm not going to say that they are all bad, but that my client suddenly solved humanity's problems.
I had a much more mundane task.
I wanted to collect in one application what I use all the time:
several SSH sessions in one window;
fast connection to saved servers;
generation and use of SSH keys;
history of connections and commands;
custom command library;
normal operation of the terminal with familiar console applications;
the ability to continue working after network errors without re-creating the entire working environment.

And without browser engines inside.
Rust, EvertyUI and no Chromium
EvertySSH is written in Rust.
For SSH, the [[T0] library is used; for asynchronous tasks, Tokio is used. History storage is implemented through SQLite, server configuration is implemented through TOML.
And the interface runs on EvertyUI.
And here comes the most interesting part.
EvertyUI is my own interface layer that is being developed within the Everty ecosystem.
He did not appear for the sake of sporting interest. When you work on multiple applications, you gradually realize how much time is spent on interfaces, state management, input processing, and constant adaptation of third-party libraries.
However, the applications themselves can be completely different.
EvertyDesk works with remote desktops. File manager - with directories and files. SSH client with terminal output streams.
But buttons, input fields, lists, scrolling, mouse and keyboard handling are needed everywhere.
I decided to take this part to my own library.
There are currently two main Rust-crates in the EvertySSH repository:
EvertySSH/
├── Cargo.toml
└── crates/
├── everty-ui/
│ ├── src/
│ ├── tests/
│ └── benches/
└── everty-ssh/
└── src/
├── main.rs
├── app.rs
├── ui.rs
├── ssh.rs
├── terminal.rs
├── config.rs
└── db.rsEvertyUI does not need to know what SSH, remote server or command history is.
It must provide mechanisms for constructing and displaying the interface.
And vice versa: the SSH subsystem does not need to know what color the connect button is.
It sounds obvious, but in practice such a division has to be constantly protected from the temptation to make an exception “for just one small function.”
That's why EvertyUI even has an architectural test that checks for the absence of dependencies on components of other products.
How is the interface generally drawn?
In EvertySSH I don't use Chromium or WebView.
To create a window and handle events, winit is used, and image output is done via softbuffer.
EvertyUI itself contains tools for geometry, layout, input processing, working with text and software rasterization.
As a result, the interface is formed in a regular pixel buffer, which is passed to the window surface.
A simplified diagram looks like this:
События Windows / Linux / macOS
|
winit
|
Состояние UI
|
EvertyUI
|
RGBA framebuffer
|
softbuffer
|
Окно приложенияCurrently EvertyUI uses cosmic-text for the text pipeline and resvg for the vector graphics.
At the same time, the engine itself has separate components for layout, DPI, scrolling, text fields, pop-ups and virtualized lists.
Why go through so much fuss for a simple SSH client?
Because I need more than just an SSH client.
I want to have a front-end framework that can be used in other projects.
EvertySSH was a convenient test case for this idea: an application complex enough to identify front-end problems, but self-contained enough not to drag EvertyDesk's architecture with it.
SSH session is a separate asynchronous task
I moved the network part to ssh.rs.
The connection goes through several stages: TCP, authentication, creation of an SSH channel, PTY request and launching a remote shell.
These operations are subject to separate time limits.
For example, connecting to a server is limited to seven seconds, and creating a shell is limited to five.
This is done for the sake of predictable interface behavior.
If the server is unavailable, the program should report this, and not endlessly display activity.
Once a connection is established for the session, an asynchronous task is launched that processes incoming and outgoing data.
Simplified:
tokio::select! {
Some(data) = input_rx.recv() => {
// Отправка пользовательского ввода
}
Some((cols, rows)) = resize_rx.recv() => {
// Изменение размера удалённого PTY
}
msg = channel.wait() => {
// Чтение вывода удалённой оболочки
}
}The specific implementation is in ssh.rs.
So the terminal interface and the network connection are not required to operate in the same synchronous cycle.
If the connection fails, the application can save session information and display the reason.
For me, this is more important than trying to make some spectacular connection animation.
The terminal is not just a text field
When I started thinking about creating my own SSH client, the most obvious part seemed to be the terminal.
We receive bytes from the server and display the characters on the screen.
It would seem that what could be simpler?
And then you remember about ANSI escape sequences, cursor movement, line clearing, colors, alternate screen, scrolling and full-screen console applications.
A terminal is an entire state machine.
In EvertySSH, vte is used to process control sequences, and the screen state itself is implemented separately.
Each cell stores a symbol and its display parameters:
pub struct Cell {
pub ch: char,
pub fg: Color,
pub bg: Color,
pub bold: bool,
pub underline: bool,
}The screen has its own dimensions, cursor position, current colors, scroll history, and alternate buffer.
The latter is especially important for programs like vim, nano or htop.
They don't just type text sequentially, but control entire areas of the screen.
And if you implement buffer switching incorrectly, the terminal will very quickly turn into a mess.
I do not claim that my implementation already supports absolutely all the features of modern terminals. This is a large area in which there is always another control sequence that can surprise the developer.
But the architecture itself already allows you to work with the terminal screen independently of SSH and interface widgets.
Tabs and split screen

The next challenge is working with multiple servers.
I didn't want to open a separate application window for each connection.
EvertySSH uses tabs and a split workspace mode to work with two terminals simultaneously.
This in itself is not a revolution.
But in daily work this mode is convenient: in one part of the screen you can monitor the log, and in the other you can check the status of the service.
For me, the admin interface should primarily save on switching between windows.
Don't create them.
Command history - separate from terminal history
Another thing that I constantly lacked was a proper history of my own work.
Yes, Bash has .bash_history.
But the history of the shell and the history of the SSH client's actions are different entities.
The same command can be executed on different servers. Sometimes it is important to know not just what was entered, but also where, when and in what session.
That's why EvertySSH uses SQLite.
The database has three main tables:
sessions
command_history
snippetsFor sessions, the server address, user, start and end times, connection status, and error message are stored.
For commands - text, time, server, session affiliation and marking favorites.
This provides a basis for searching through history and reusing commands.
A separate command palette has been implemented, accessible via Ctrl+R.
At the same time, I deliberately separate the history of entered commands and the terminal screen buffer. The complete terminal output stream and the user activity log do not have to be the same data structure.
There is, of course, the issue of privacy: teams sometimes contain tokens, passwords and other secrets. Therefore, filtering such data is one of the important tasks for further refinement.
Snippets

Constantly typing commands is another source of minor irritation.
View Docker containers, check ports, output load, open systemd logs.
Every time you remember the syntax or go into the command history.
I have added a snippet library to EvertySSH.
The snippet contains the title, command, category and description.
For example, in the database there is this option:
docker ps --format \
'table {{.Names}}\t{{.Status}}\t{{.Ports}}'Or a quick view of the system status:
uname -a && uptime && free -h && df -hYou can create your own teams and group them by categories.
When running a snippet, confirmation of completion is provided.
This is especially important for teams that change the state of the system.
But here I don’t want to turn the SSH client into a visual automation designer.
I want a regular terminal with a few handy tools nearby.
Generating SSH keys

Authorization is a separate story.
The project provides for working with SSH Agent, passwords and keys, as well as generating Ed25519 and RSA-4096.
In the interface you can prepare a key pair and organize the installation of a public key on a remote server.
The idea is simple: basic access configuration operations should be available from one application.
But this is the part where convenience cannot be put above correct cryptography.
There is a flaw in the current code that I believe needs to be fixed before I recommend using the client in sensitive production environments.
Currently, the SSH handler accepts the key presented by the server without checking against known_hosts.
This essentially means that the application is not yet authenticating the server as it should.
This is not a minor detail or a cosmetic flaw: such behavior can create the conditions for a man-in-the-middle attack.
The next step is a normal check of the host key, saving trusted keys and an explicit warning when they change.
The storage of sensitive authorization parameters and the master password protection mechanism also require improvement.
I prefer to state these limitations up front rather than declaring an application safe just because it's written in Rust.
Rust protects against a whole class of memory errors, but does not correct security design errors.
Why EvertyUI is important to me
You can ask a completely logical question: why write your own UI engine?
The answer is quite simple.
I don't think the world urgently needs another universal front-end framework.
EvertyUI is being created because my applications need it.
When an interface becomes a common component of several products, its development begins to bring practical benefits.
Fixed focus handling - the change can be transferred to other applications.
Optimized the text pipeline - more than one screen gets the benefit.
If you have finalized the scrolling components or work with DPI, you don’t need to solve these problems again in the next project.
At the same time, your own UI engine is an additional responsibility.
Now the problems with input, layout, rendering and platform compatibility are also mine.
No one will automatically correct them for me.
But this is exactly the kind of control I was looking for.
Instead of a conclusion
EvertySSH didn't come about because I wanted to prove Rust's superiority over other languages or write a PuTTY killer.
It’s just that at some point I got tired of adjusting my own work to inconvenient little things.
And since I already had EvertyUI, I had the opportunity to try to solve this problem myself.
The result is another product and, what is even more interesting for me, another practical test of our own interface engine.
You can endlessly design architecture, draw diagrams and discuss abstractions.
But the real test begins when an application that you yourself use appears on this architecture.
I don’t need EvertyUI to write EvertyUI. You need it to write programs.
EvertySSH source code is published on GitHub:
https://github.com/vaalimusic/EvertySSH
The project is distributed under the MIT license.
I will be glad to receive technical comments, especially on the compatibility of the terminal emulator, processing of SSH sessions and the architecture of the interface layer.
💬 Discussion 0
BBCode & Emoji supportedParticipate in discussions, ask authors questions, and share benchmarks by joining the ProArena engineering community.