--- ./cryptlib.h.orig	2024-09-04 00:25:26.000000000 -0400
+++ ./cryptlib.h	2024-10-31 00:50:21.388918000 -0400
@@ -1271,6 +1271,11 @@
 	CRYPT_SESSINFO_TLS_EAPDATA,		/* TLS EAP additional data */
 	CRYPT_SESSINFO_TSP_MSGIMPRINT,	/* TSP message imprint */
 
+	/* Terminal attributes */
+	CRYPT_SESSINFO_SSH_TERMINAL,	/* TERM string sent to remote */
+	CRYPT_SESSINFO_SSH_WIDTH,	/* Terminal width */
+	CRYPT_SESSINFO_SSH_HEIGHT,	/* Terminal height */
+
 	/* Used internally */
 	CRYPT_SESSINFO_LAST, CRYPT_USERINFO_FIRST = 7000,
 
--- ./session/ssh2_msgcli.c.orig	2023-02-08 05:37:02.000000000 -0500
+++ ./session/ssh2_msgcli.c	2024-10-31 00:50:21.392905000 -0400
@@ -450,6 +450,12 @@
 												CHANNEL_WRITE );
 	int packetOffset, status;
 
+	MESSAGE_DATA	term;
+	BYTE termString[ CRYPT_MAX_TEXTSIZE + 8 ];
+	int value;
+
+	term.data=termString;
+	term.length=CRYPT_MAX_TEXTSIZE;
 	assert( isWritePtr( sessionInfoPtr, sizeof( SESSION_INFO ) ) );
 	assert( isWritePtr( stream, sizeof( STREAM ) ) );
 
@@ -549,9 +555,18 @@
 	writeUint32( stream, channelNo );
 	writeString32( stream, "pty-req", 7 );
 	sputc( stream, 0 );					/* No reply */
-	writeString32( stream, "xterm", 5 );/* Generic */
-	writeUint32( stream, 80 );
-	writeUint32( stream, 48 );			/* 48 x 80 (24 x 80 is so 1970s) */
+	if( cryptStatusError( status = getSessionAttributeS( sessionInfoPtr, &term, CRYPT_SESSINFO_SSH_TERMINAL) ) )
+		writeString32( stream, "xterm", 5 );/* Generic */
+	else
+		writeString32( stream, term.data, term.length );/* Generic */
+	if( cryptStatusError( getSessionAttribute( sessionInfoPtr, &value, CRYPT_SESSINFO_SSH_WIDTH ) ) )
+		writeUint32( stream, 80 );
+	else
+		writeUint32( stream, value);
+	if( cryptStatusError( getSessionAttribute( sessionInfoPtr, &value, CRYPT_SESSINFO_SSH_HEIGHT ) ) )
+		writeUint32( stream, 48 );		/* 48 x 80 (24 x 80 is so 1970s) */
+	else
+		writeUint32( stream, value);
 	writeUint32( stream, 0 );
 	writeUint32( stream, 0 );			/* No graphics capabilities */
 	status = writeUint32( stream, 0 );	/* No special TTY modes */
--- ./session/sess_attr.c.orig	2024-10-07 00:25:28.000000000 -0400
+++ ./session/sess_attr.c	2024-10-31 00:50:21.397162000 -0400
@@ -816,6 +816,8 @@
 								   SESSION_FLAG_ISOPEN ) ? TRUE : FALSE;
 			return( CRYPT_OK );
 
+		case CRYPT_SESSINFO_SSH_HEIGHT:
+		case CRYPT_SESSINFO_SSH_WIDTH:
 		case CRYPT_SESSINFO_SERVER_PORT:
 		case CRYPT_SESSINFO_CLIENT_PORT:
 			{
@@ -891,6 +893,7 @@
 			return( CRYPT_ERROR_NOTFOUND );
 			}
 
+		case CRYPT_SESSINFO_SSH_TERMINAL:
 		case CRYPT_SESSINFO_USERNAME:
 		case CRYPT_SESSINFO_PASSWORD:
 		case CRYPT_SESSINFO_AUTHTOKEN:
@@ -1059,6 +1062,13 @@
 			return( status );
 			}
 
+		case CRYPT_SESSINFO_SSH_WIDTH:
+			return( addSessionInfo( sessionInfoPtr,
+									CRYPT_SESSINFO_SSH_WIDTH, value ) );
+		case CRYPT_SESSINFO_SSH_HEIGHT:
+			return( addSessionInfo( sessionInfoPtr,
+									CRYPT_SESSINFO_SSH_HEIGHT, value ) );
+
 		case CRYPT_SESSINFO_SERVER_PORT:
 			/* If there's already a network socket specified then we can't 
 			   set a port as well */
@@ -1227,6 +1237,9 @@
 			return( addCredential( sessionInfoPtr, data, dataLength, 
 								   attribute ) );
 
+		case CRYPT_SESSINFO_SSH_TERMINAL:
+		case CRYPT_SESSINFO_SSH_WIDTH:
+		case CRYPT_SESSINFO_SSH_HEIGHT:
 		case CRYPT_SESSINFO_SERVER_FINGERPRINT_SHA1:
 			/* Remember the value */
 			return( addSessionInfoS( sessionInfoPtr, attribute, data, 
@@ -1290,6 +1303,7 @@
 			sessionInfoPtr->writeTimeout = CRYPT_ERROR;
 			return( CRYPT_OK );
 
+		case CRYPT_SESSINFO_SSH_TERMINAL:
 		case CRYPT_SESSINFO_USERNAME:
 		case CRYPT_SESSINFO_PASSWORD:
 		case CRYPT_SESSINFO_AUTHTOKEN:
--- ./kernel/attr_acl.c.orig	2024-07-24 20:25:30.000000000 -0400
+++ ./kernel/attr_acl.c	2024-10-31 00:50:21.402631000 -0400
@@ -3908,6 +3908,25 @@
 		MKPERM_TSP( xWD_xWD ),
 		ROUTE( OBJECT_TYPE_SESSION ), &objectCtxHash ),
 
+	MKACL_S(	/* SSH client: Read/write */
+		CRYPT_SESSINFO_SSH_TERMINAL,
+		ST_NONE, ST_NONE, ST_SESS_SSH, 
+		0xffffffff /*MKPERM_SSH_EXT( RWD_RWD )*/,
+		ROUTE( OBJECT_TYPE_SESSION ),
+		RANGE( 1, CRYPT_MAX_TEXTSIZE ) ),
+	MKACL_N(	/* SSH client: Read/write */
+		CRYPT_SESSINFO_SSH_WIDTH,
+		ST_NONE, ST_NONE, ST_SESS_SSH, 
+		0xffffffff /*MKPERM_SSH_EXT( RWD_RWD )*/,
+		ROUTE( OBJECT_TYPE_SESSION ),
+		RANGE( 1, 800 ) ),
+	MKACL_N(	/* SSH client: Read/write */
+		CRYPT_SESSINFO_SSH_HEIGHT,
+		ST_NONE, ST_NONE, ST_SESS_SSH, 
+		0xffffffff /*MKPERM_SSH_EXT( RWD_RWD )*/,
+		ROUTE( OBJECT_TYPE_SESSION ),
+		RANGE( 1, 800 ) ),
+
 	MKACL_END(), MKACL_END()
 	};
 #endif /* USE_SESSIONS */
