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

Re: Handle control characters in ssh shell server


Hi Prapatsorn,

This has to do with the terminal encoding. By default, libssh sends
"xterm" (or was it "vt100"?) and so the remote shell is expected to send
xterm/vt100 control characters. If your local terminal does not
understand them, you have to do the conversion.

I'm unfortunately not very familiar with terminal codes parsing, and we
always avoided dealing with the content of terminal/X11 channels,
however if you have good ideas I'll take them.

Aris


On 6/07/17 11:12, Prapatsorn Wisuttirungseurai wrote:
> I have implemented ssh server using libssh as a shell server. I used
> ssh_channel_read() and ssh_channel_write() to handle the character
> between the server and client.
>
> I dealt with the problem about the control character from client's key
> such as 'Backspace', 'Esc' and so on. It seems like nothing happens on
> the client's console when using ssh_channel_write() to send that
> character straightforwardly. And I found the solution from this
> issue: https://www.libssh.org/archive/libssh/2014-08/0000005.html
> <https://www.libssh.org/archive/libssh/2014-08/0000005.html>
>
> I just wonder that do I need to handle every control character to
> affect as its real action? or it has the better solution?
>
> Thanks.
> Prapatsorn



References:
Handle control characters in ssh shell serverPrapatsorn Wisuttirungseurai <prapatsorn416@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org