[mosh-devel] college student seeking guidance with regards to mosh client on iOS

Geoffrey Thomas geofft at ldpreload.com
Mon May 18 17:40:00 EDT 2015


Hi Amanda,

Two years back I started looking at this, and I started a branch to 
experiment with refactoring some of the terminal-display code to make it 
usable as a static library that just gives you access to the framebuffer 
object. My reasoning was that iOS doesn't let you have subprocesses, and 
Mosh is already maintaining its own virtual terminal screen anyway (since 
that's what it's syncing from server to client). Because mosh-client is a 
program running inside a terminal emulator like Terminal.app, it then 
generates deltas between each terminal screen, in the form of ANSI escape 
sequences. But if you're writing your own app specifically for mosh, it's 
simpler just to get access to the virtual terminal screen directly (a 2-D 
array of characters, basically), and map that directly to the screen 
widget. This way you don't have to implement a terminal emulator just to 
undo the framebuffer-to-terminal conversion mosh-client does.

I have a branch at https://github.com/geofft/mosh/commits/embeddedclient 
that was intended to generate a libmosh.a that you can use in XCode. a 
There's a sample client in src/frontend/emdriver.c, with a very short 
function "dump_frame_diffs" that just runs printf() on changes.

I'm on #mosh on Freenode if you want to chat more about this approach or 
about the C++ code. It's been a while but I can try to remember how things 
work and rebase my branch to current mosh if that would be helpful.

-- 
Geoffrey Thomas
https://ldpreload.com
geofft at ldpreload.com

On Sun, 17 May 2015, Amanda Chan wrote:

> Hello!
> I'm Amanda, a CS undergrad at the University of Waterloo. I've been really wanting to write an mosh client for iOS for a while, and have been digging through the source
> code, but getting confused. I have experience developing iOS apps, and have some experience with C++,  but the mosh C++ source code is really confusing me, and I don't
> know where else to look.
> 
>  I know that I have to write an Obj-C wrapper for the UI components, and any functions that are called when a user inputs things, and for things that are output to the
> screen, but in the C++, I'm having trouble figuring out where those pieces are, or how the terminal emulator will look. 
> 
> I'm not sure whether or not I need to roll out my own iOS terminal emulator or if mosh has support for that, because I see a folder which has a bunch of terminal related
> classes and functions, and terminaloverlay class, which seems to handle input, but where is this called? Where is the code that tells me what's supposed to happen when the
> user enters their credentials, where is the code that tells you that the output is supposed to be, and how it's presented?  
> 
> So sorry for the bombardment of questions, just really not sure how to read this, and looking for some guidance as to how to read the source code and any advice for
> writing mosh clients for iOS. Sorry for asking some pretty stupid questions, trying to find my way around this stuff and getting lost.
> 
> Thanks!
> amanda chan
> 
>


More information about the mosh-devel mailing list