summaryrefslogtreecommitdiffhomepage
path: root/cli-chansession.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2004-08-01 09:41:37 +0000
committerMatt Johnston <matt@ucc.asn.au>2004-08-01 09:41:37 +0000
commit55c9b4564937d6f3348896d010bde2bb3711a1fd (patch)
tree0b0c8d4e47918a3bae2318ed82ca5ac673fafe63 /cli-chansession.c
parent051b7454f80a52d2b0bea2e34562949a3bc70fe4 (diff)
added window-size change handling
--HG-- extra : convert_revision : 93a39c7b76f478035046b9c6f88af54612cce36f
Diffstat (limited to 'cli-chansession.c')
-rw-r--r--cli-chansession.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/cli-chansession.c b/cli-chansession.c
index be6fc14..e34c6fd 100644
--- a/cli-chansession.c
+++ b/cli-chansession.c
@@ -203,6 +203,32 @@ static void put_winsize() {
}
+static void sigwinch_handler(int dummy) {
+
+ cli_ses.winchange = 1;
+
+}
+
+void cli_chansess_winchange() {
+
+ unsigned int i;
+ struct Channel *channel = NULL;
+
+ for (i = 0; i < ses.chansize; i++) {
+ channel = ses.channels[i];
+ if (channel != NULL && channel->type == &clichansess) {
+ CHECKCLEARTOWRITE();
+ buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_REQUEST);
+ buf_putint(ses.writepayload, channel->remotechan);
+ buf_putstring(ses.writepayload, "window-change", 13);
+ buf_putbyte(ses.writepayload, 0); /* FALSE says the spec */
+ put_winsize();
+ encrypt_packet();
+ }
+ }
+ cli_ses.winchange = 0;
+}
+
static void send_chansess_pty_req(struct Channel *channel) {
unsigned char* term = NULL;
@@ -228,6 +254,11 @@ static void send_chansess_pty_req(struct Channel *channel) {
put_termcodes();
encrypt_packet();
+
+ /* Set up a window-change handler */
+ if (signal(SIGWINCH, sigwinch_handler) == SIG_ERR) {
+ dropbear_exit("signal error");
+ }
TRACE(("leave send_chansess_pty_req"));
}
@@ -275,7 +306,6 @@ static int cli_initchansess(struct Channel *channel) {
}
-
void cli_send_chansess_request() {
TRACE(("enter cli_send_chansess_request"));