Re: What magic did openssh do to handle programs like VIM?

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



On Mon, Feb 10, 2014 at 7:39 PM, Aaron Lewis <the.warl0ck.1989@xxxxxxxxx> wrote:
> I'm trying to write my own remote shell program,
[...]
> 2. If I run command like VIM, it doesn't run.
>     And buttons like "<ESC>:q" won't work
>
> Can someone enlighten me about what SSH did, so it all works perfectly?

Pseudo terminals: http://en.wikipedia.org/wiki/Pseudo_terminal.  ssh
asks sshd for one when you run an interactive shell (eg "ssh
yourserver") or you use the -t flag.  You can run vim via ssh without
a pty and it'll behave like your application: "ssh server vim
somefile".

If you can find a copy of Stevens' Advanced Programming in the Unix
Environment it's got a chapter on PTYs that's pretty good.  Failing
that, take a look at the openpty man page and the code in openssh's
sshpty.c.

if you don't have openpty then your task just got harder because it's
quite platform-specific; take a look in openbsd-compat/bsd-openpty.c.

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev




[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux