Subject: Re: Remote Terminal with iPhone SDK

Re: Remote Terminal with iPhone SDK

From: Paresh Thakor <paresh.thakor_at_moontechnolabs.com>
Date: Wed, 14 Jul 2010 16:28:20 +0530

Hey Peter,

Back here again, I had long pause after our few days chat long ago. I was working on the mobile terminal code you suggested and few other applications. So, got somewhat free to have close look on the application you suggested.

After close inspection and debugging methods, we've come to know that the application doesn't use libssh. It uses built-in terminal (TTY) through files. Like, dumping all commands and o/p in a file. And the code is written with fully integration with other classes, so, generally very time consuming to get it work for our application.

I tried to use libssh2 for the application with a try. But not able to parse the output because output in mobile terminal comes from dumped file which is not the case for libssh2. i've tried to decode o/p from libssh2 command execution but not very easy to make it done. Few other ooptions also i've tried..! Right now, i'm implementing libssh2 command execution as it's because it's working in my application. Just trying to reuse the decoding functionality for the app, so, i can make the o/p to be displayed on the screen (UIView).

Could you please suggest me something so i can reuse for my application? I am somewhat stuck with the application, due to VI and nano editior commands and top command as well..!

Regards,
Paresh Thakor.

On Jun 28, 2010, at 4:33 PM, Paresh Thakor wrote:

>
> Hi, Thanks Peter for your response and i'm now making some research on what you suggested..! Thanks.
>
>
> On Jun 28, 2010, at 4:26 PM, Peter Stuge wrote:
>
>> Paresh Thakor wrote:
>>> Thanks for your kind reply... but you say that i am using libssh2
>>> in proper way that i don't think right.
>>
>> Yes. The problem you are facing has nothing to do with libssh2. The
>> part of your program that *is* related to libssh2 is already working
>> correctly for you.
>>
>>
>>> Because i need to create a proper and complete terminal emulator
>>> and i resulted in simple UITextView based command/output system.
>>
>> http://developer.apple.com/iphone/library/documentation/uikit/reference/UITextView_Class/Reference/UITextView.html
>>
>> "The UITextView class implements the behavior for a scrollable,
>> multiline text region."
>>
>> UITextView is completely useless as a terminal emulator.
>>
>>
>>> And i can't get what it PuTTY, i made some search on that but
>>> there's no proper answer for the suggestion.
>>
>> The first hit on google.com is:
>>
>> http://www.chiark.greenend.org.uk/~sgtatham/putty/
>> PuTTY: A Free Telnet/SSH Client
>>
>> Surely you saw that? Study the source code. Learn about terminal
>> emulators. Also search for information about terminal emulators of
>> course, and study the material that you find.
>>
>> Again, the first hit on google.com is:
>>
>> http://en.wikipedia.org/wiki/Terminal_emulator
>>
>> If you have problems even finding this quite basic information then
>> I would caution against continuing this project now. Terminal
>> emulators will cause you much more trouble.
>>
>>
>>> IF you know iPhone programming then suggest me something.
>>
>> I don't.
>>
>>
>>> rc = libssh2_channel_request_pty( channel, "xterm"); This is my PTY
>>> function. I don't know what to use to display terminal so it looks
>>> like real termina.
>>
>> In the function call you tell the server that you are xterm.
>> (xterm is one specific terminal program.)
>>
>> Now the server will use the escape sequences that xterm understands.
>> In order to display the screen correctly you must interpret them in
>> your program. This is what a terminal emulator does. You can look at
>> the xterm source code, but xterm is very full featured and the code
>> is rather large, so it is not the best reference for a minimal
>> terminal emulator.
>>
>> It seems that someone is already working on what you need. The very
>> first hit on google.com when searching for iphone terminal emulator
>> is:
>>
>> http://code.google.com/p/mobileterminal/
>> mobileterminal
>> A GUI Terminal application for the iPhone
>>
>> Integrate this with libssh2 correctly and you might be finished
>> already.
>>
>>
>> //Peter
>> _______________________________________________
>> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-07-14