The Guacamole project is using the libssh2 library to create SSH connections to servers. One of the things we've determined is that it would be useful to pass through the VERASE terminal mode encoding option in SSH so that the remote system has a better chance of knowing what the client is sending for the Backspace key. libssh2 contains a function, libssh2_channel_request_pty_ex()
, which allows various data about the terminal to be passed on to the SSH server, including these encoding options. The documentation for the function is here:
https://libssh2.org/libssh2_channel_request_pty_ex.html
The modes
argument is a char *
that is supposed to let you pass the various terminal encoding opcodes and values through, but I'm having trouble figuring out how to put the opcodes and values together into the char *modes
variable in order to pass them through in a way that is valid.
There's a Java SSH client that has similar options that appears to use a byte[]
object to accomplish this, but even it isn't very well-documented.
From looking at the source code for libssh2 and the channel_request_pty()
function, it looks like the data specified in modes
is just appended to the request buffer that is built up with the other data passed on when requested a pty (the name of the terminal and size of the terminal), so I expect that this char *modes
variable expects these opcodes and values to be in the exact format that the SSH server will require when they are passed over the wire and read on the other side, but I'm not really familiar enough with SSH to know what that format is, and am struggling to find documentation or code examples that help me figure that out.
Can anyone provide hints, insight, or examples of this?