diff --git a/src/syncterm/ssh.c b/src/syncterm/ssh.c index 4e7e32585ff68e30f8e3d12480ca610fedb83080..186523ac4433d8e8c29548a70bbfcf3c77a6b256 100644 --- a/src/syncterm/ssh.c +++ b/src/syncterm/ssh.c @@ -12,6 +12,7 @@ #include "bbslist.h" #include "conn.h" #include "uifcinit.h" +#include "ciolib.h" #include "st_crypt.h" @@ -140,6 +141,8 @@ int ssh_connect(struct bbslist *bbs) int status; char password[MAX_PASSWD_LEN+1]; char username[MAX_USER_LEN+1]; + struct winsize ws; + struct text_info ti; init_uifc(TRUE, TRUE); pthread_mutex_init(&ssh_mutex, NULL); @@ -227,6 +230,38 @@ int ssh_connect(struct bbslist *bbs) return(-1); } + uifc.pop(NULL); + uifc.pop("Setting Terminal Type"); + status=cl.SetAttributeString(ssh_session, CRYPT_SESSINFO_SSH_TERMINAL, "syncterm", 8); + + /* Horrible way to determine the screen size */ + textmode(screen_to_ciolib(bbs->screen_mode)); + + gettextinfo(&ti); + if(ti.screenwidth < 80) + ws.ws_col=40; + else { + if(ti.screenwidth < 132) + ws.ws_col=80; + else + ws.ws_col=132; + } + ws.ws_row=ti.screenheight; + if(!bbs->nostatus) + ws.ws_row--; + if(ws.ws_row<24) + ws.ws_row=24; + + uifc.pop(NULL); + uifc.pop("Setting Terminal Width"); + /* Pass socket to cryptlib */ + status=cl.SetAttribute(ssh_session, CRYPT_SESSINFO_SSH_WIDTH, ws.ws_col); + + uifc.pop(NULL); + uifc.pop("Setting Terminal Height"); + /* Pass socket to cryptlib */ + status=cl.SetAttribute(ssh_session, CRYPT_SESSINFO_SSH_HEIGHT, ws.ws_row); + /* Activate the session */ uifc.pop(NULL); uifc.pop("Activating Session");