From 0d0222c7e7df79f7b7ac3800776e358a452b0dc7 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sun, 7 Aug 2016 13:12:54 +1000 Subject: [PATCH] attempt non canonical mode --- main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 35e15cf..8f35f2e 100644 --- a/main.c +++ b/main.c @@ -22,6 +22,7 @@ #else # include #endif +#include #include "bbs.h" #include "inih/ini.h" @@ -473,6 +474,9 @@ void serverssh(int port) { ssh_event event; short events; ssh_message message; + struct termios tios; + + err = ssh_init(); if (err == -1) { fprintf(stderr, "Error starting SSH server.\n"); @@ -554,9 +558,13 @@ void serverssh(int port) { ip = ssh_getip(p_ssh_session); + + bbs_pid = forkpty(&fd, NULL, NULL, NULL); if (bbs_pid == 0) { - setvbuf(stdin,NULL,_IONBF,0); + tcgetattr(master, &tios); + tios.c_lflag &= ~(ICANON | ECHO | ECHONL); + tcsetattr(master, TCSAFLUSH, &tios); runbbs_ssh(ip); exit(0); }