--- session/ssh2_msgcli.c.orig	2024-02-22 23:16:43.222270000 -0500
+++ session/ssh2_msgcli.c	2024-02-22 23:18:46.291612000 -0500
@@ -665,8 +665,8 @@
 
 	/* The channel has been successfully created, mark it as active and
 	   select it for future exchanges */
-	status = setChannelExtAttribute( sessionInfoPtr, SSH_ATTRIBUTE_ACTIVE, 
-									 TRUE );
+	//status = setChannelExtAttribute( sessionInfoPtr, SSH_ATTRIBUTE_ACTIVE, 
+	//								 TRUE );
 	if( cryptStatusOK( status ) && currentChannelNo != channelNo )
 		{
 		/* It's unclear why anyone would want to use different channel
@@ -691,7 +691,7 @@
 			}
 		}
 	if (cryptStatusOK(status))
-		status = selectChannel( sessionInfoPtr, currentChannelNo, CHANNEL_BOTH );
+		status = selectChannel( sessionInfoPtr, currentChannelNo, CHANNEL_NONE );
 	if( cryptStatusError( status ) ) {
 		selectChannel( sessionInfoPtr, origWriteChannelNo, CHANNEL_WRITE );
 		return( status );
--- session/ssh2_msg.c.orig	2024-02-22 23:16:43.054457000 -0500
+++ session/ssh2_msg.c	2024-02-22 23:16:43.235069000 -0500
@@ -323,6 +323,14 @@
 			return processChannelOpenFailure(sessionInfoPtr, stream);
 		case SSH_MSG_CHANNEL_OPEN_CONFIRMATION:
 			return processChannelOpenConfirmation(sessionInfoPtr, stream);
+		case SSH_MSG_CHANNEL_SUCCESS:
+			channelNo = readUint32( stream );
+			if( cryptStatusError( channelNo ) )
+				return channelNo;
+			if (cryptStatusOK(status))
+				status = selectChannel( sessionInfoPtr, channelNo, CHANNEL_BOTH );
+			status = setChannelExtAttribute( sessionInfoPtr, SSH_ATTRIBUTE_ACTIVE, TRUE);
+			return status;
 		default:
 			{
 #ifdef USE_ERRMSGS
