[Ttssh2-commit] [5587] ONLCRのon / offを送るようにした。

svnno****@sourc***** svnno****@sourc*****
2014年 5月 19日 (月) 12:11:54 JST


Revision: 5587
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5587
Author:   doda
Date:     2014-05-19 12:11:52 +0900 (Mon, 19 May 2014)
Log Message:
-----------
ONLCRのon/offを送るようにした。

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/ssh.c
    trunk/ttssh2/ttxssh/ssh.h

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2014-05-18 04:46:16 UTC (rev 5586)
+++ trunk/ttssh2/ttxssh/ssh.c	2014-05-19 03:11:52 UTC (rev 5587)
@@ -7137,27 +7137,36 @@
 	buffer_put_int(msg, y);  // window height (pixel):
 
 	// TTY mode\x82͂\xB1\x82\xB1\x82œn\x82\xB7 (2005.7.17 yutaka)
-#if 0
-	s = "";
-	buffer_put_string(msg, s, strlen(s));
-#else
-	buffer_put_char(ttymsg, 129);  // TTY_OP_OSPEED_PROTO2
+	buffer_put_char(ttymsg, SSH2_TTY_OP_OSPEED);
 	buffer_put_int(ttymsg, 9600);  // baud rate
-	buffer_put_char(ttymsg, 128);  // TTY_OP_ISPEED_PROTO2
+	buffer_put_char(ttymsg, SSH2_TTY_OP_ISPEED);
 	buffer_put_int(ttymsg, 9600);  // baud rate
+
 	// VERASE
-	buffer_put_char(ttymsg, 3);
+	buffer_put_char(ttymsg, SSH2_TTY_KEY_VERASE);
 	if (pvar->ts->BSKey == IdBS) {
 		buffer_put_int(ttymsg, 0x08); // BS key
 	} else {
 		buffer_put_int(ttymsg, 0x7F); // DEL key
 	}
-	// TTY_OP_END
-	buffer_put_char(ttymsg, 0);
 
+	switch (pvar->ts->CRReceive) {
+	  case IdLF:
+		buffer_put_char(ttymsg, SSH2_TTY_OP_ONLCR);
+		buffer_put_int(ttymsg, 0);
+		break;
+	  case IdCR:
+		buffer_put_char(ttymsg, SSH2_TTY_OP_ONLCR);
+		buffer_put_int(ttymsg, 1);
+		break;
+	  default:
+		break;
+	}
+
+	buffer_put_char(ttymsg, SSH2_TTY_OP_END); // End of terminal modes
+
 	// SSH2\x82ł͕\xB6\x8E\x9A\x97\xF1\x82Ƃ\xB5\x82ď\x91\x82\xAB\x8D\x9E\x82ށB
 	buffer_put_string(msg, buffer_ptr(ttymsg), buffer_len(ttymsg));
-#endif
 
 	len = buffer_len(msg);
 	outmsg = begin_send_packet(pvar, SSH2_MSG_CHANNEL_REQUEST, len);

Modified: trunk/ttssh2/ttxssh/ssh.h
===================================================================
--- trunk/ttssh2/ttxssh/ssh.h	2014-05-18 04:46:16 UTC (rev 5586)
+++ trunk/ttssh2/ttxssh/ssh.h	2014-05-19 03:11:52 UTC (rev 5587)
@@ -197,7 +197,65 @@
 #define SSH2_OPEN_UNKNOWN_CHANNEL_TYPE           3
 #define SSH2_OPEN_RESOURCE_SHORTAGE              4
 
+// Terminal Modes
+#define SSH2_TTY_OP_END		0
+#define SSH2_TTY_KEY_VINTR	1
+#define SSH2_TTY_KEY_VQUIT	2
+#define SSH2_TTY_KEY_VERASE	3
+#define SSH2_TTY_KEY_VKILL	4
+#define SSH2_TTY_KEY_VEOF	5
+#define SSH2_TTY_KEY_VEOL	6
+#define SSH2_TTY_KEY_VEOL2	7
+#define SSH2_TTY_KEY_VSTART	8
+#define SSH2_TTY_KEY_VSTOP	9
+#define SSH2_TTY_KEY_VSUSP	10
+#define SSH2_TTY_KEY_VDSUSP	11
+#define SSH2_TTY_KEY_VREPRINT	12
+#define SSH2_TTY_KEY_VWERASE	13
+#define SSH2_TTY_KEY_VLNEXT	14
+#define SSH2_TTY_KEY_VFLUSH	15
+#define SSH2_TTY_KEY_VSWTCH	16
+#define SSH2_TTY_KEY_VSTATUS	17
+#define SSH2_TTY_KEY_VDISCARD	18
+#define SSH2_TTY_OP_IGNPAR	30
+#define SSH2_TTY_OP_PARMRK	31
+#define SSH2_TTY_OP_INPCK	32
+#define SSH2_TTY_OP_ISTRIP	33
+#define SSH2_TTY_OP_INLCR	34
+#define SSH2_TTY_OP_IGNCR	35
+#define SSH2_TTY_OP_ICRNL	36
+#define SSH2_TTY_OP_IUCLC	37
+#define SSH2_TTY_OP_IXON	38
+#define SSH2_TTY_OP_IXANY	39
+#define SSH2_TTY_OP_IXOFF	40
+#define SSH2_TTY_OP_IMAXBEL	41
+#define SSH2_TTY_OP_ISIG	50
+#define SSH2_TTY_OP_ICANON	51
+#define SSH2_TTY_OP_XCASE	52
+#define SSH2_TTY_OP_ECHO	53
+#define SSH2_TTY_OP_ECHOE	54
+#define SSH2_TTY_OP_ECHOK	55
+#define SSH2_TTY_OP_ECHONL	56
+#define SSH2_TTY_OP_NOFLSH	57
+#define SSH2_TTY_OP_TOSTOP	58
+#define SSH2_TTY_OP_IEXTEN	59
+#define SSH2_TTY_OP_ECHOCTL	60
+#define SSH2_TTY_OP_ECHOKE	61
+#define SSH2_TTY_OP_PENDIN	62
+#define SSH2_TTY_OP_OPOST	70
+#define SSH2_TTY_OP_OLCUC	71
+#define SSH2_TTY_OP_ONLCR	72
+#define SSH2_TTY_OP_OCRNL	73
+#define SSH2_TTY_OP_ONOCR	74
+#define SSH2_TTY_OP_ONLRET	75
+#define SSH2_TTY_OP_CS7		90
+#define SSH2_TTY_OP_CS8		91
+#define SSH2_TTY_OP_PARENB	92
+#define SSH2_TTY_OP_PARODD	93
+#define SSH2_TTY_OP_ISPEED	128
+#define SSH2_TTY_OP_OSPEED	129
 
+
 // \x83N\x83\x89\x83C\x83A\x83\x93\x83g\x82\xA9\x82\xE7\x83T\x81[\x83o\x82ւ̒\xF1\x88Ď\x96\x8D\x80
 enum kex_init_proposals {
 	PROPOSAL_KEX_ALGS,



Ttssh2-commit メーリングリストの案内