mobile-shell / mobile-shell/mosh

generate terminal updates with conventional diff/delta algorithms?

Open
#817 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Research
Dominant language
C++
Stars
14.5k
Forks
865
PR merge metrics
No merged PRs in 30d

Description

I've had this idea kicking around for a while.

Mosh currently generates display updates with ad-hoc code in Terminal::Display::new_frame() and Terminal::Display::put_row(). This code generates strings to update a terminal by comparing individual cells, with some lookahead down the row, and there's also some optimization for scrolling rows. It's rather complicated stuff and a bit fragile.

It seems possible to apply conventional differencing/delta algorithms to a framebuffer, either at a single level treating the entire framebuffer as a single long string, or at two levels-- complete rows and characters within each row. Each character cell, complete with Unicode code points and attributes, would be treated as a single symbol by the diff algorithm.

I'm not sure this would actually be an improvement, but it might get us simpler code and more compact diffs (display updates), and seems worth a closer look.

Another idea is to transmit generalized deltas from server to client, rather than terminal-oriented update strings. That would be a huge, incompatible change, called mosh2 :)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Terminal::Display::new_frame() and Terminal::Display::put_row(), where the current cell comparison, lookahead, and scrolling optimizations live. Evaluate whether a conventional framebuffer or row-level diff can simplify the implementation or reduce display updates; done would require a measured comparison and a clear recommendation, since the issue is exploratory.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.