GUACAMOLE-269: Add basic support for sending TTY mode encoding.
This commit is contained in:
parent
bc1e2f5276
commit
f1bf70a4a2
@ -38,6 +38,7 @@ noinst_HEADERS = \
|
||||
settings.h \
|
||||
sftp.h \
|
||||
ssh.h \
|
||||
ttymode.h \
|
||||
user.h
|
||||
|
||||
# Add agent sources if enabled
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "sftp.h"
|
||||
#include "ssh.h"
|
||||
#include "terminal/terminal.h"
|
||||
#include "ttymode.h"
|
||||
|
||||
#ifdef ENABLE_SSH_AGENT
|
||||
#include "ssh_agent.h"
|
||||
@ -297,8 +298,8 @@ void* ssh_client_thread(void* data) {
|
||||
}
|
||||
|
||||
/* Request PTY */
|
||||
if (libssh2_channel_request_pty_ex(ssh_client->term_channel, "linux", sizeof("linux")-1, NULL, 0,
|
||||
ssh_client->term->term_width, ssh_client->term->term_height, 0, 0)) {
|
||||
if (libssh2_channel_request_pty_ex(ssh_client->term_channel, "linux", sizeof("linux")-1, guac_tty_modes,
|
||||
sizeof(guac_tty_modes), ssh_client->term->term_width, ssh_client->term->term_height, 0, 0)) {
|
||||
guac_client_abort(client, GUAC_PROTOCOL_STATUS_UPSTREAM_ERROR, "Unable to allocate PTY.");
|
||||
return NULL;
|
||||
}
|
||||
|
36
src/protocols/ssh/ttymode.h
Normal file
36
src/protocols/ssh/ttymode.h
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
#ifndef GUAC_SSH_TTYMODE_H
|
||||
#define GUAC_SSH_TTYMODE_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define TTY_OP_END 0
|
||||
#define TTY_OP_VERASE 3
|
||||
|
||||
#define GUAC_SSH_TERM_DEFAULT_BACKSPACE 127
|
||||
|
||||
char guac_tty_modes[] = {
|
||||
TTY_OP_VERASE,
|
||||
0, 0, 0, GUAC_SSH_TERM_DEFAULT_BACKSPACE,
|
||||
TTY_OP_END
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user