[Ttssh2-commit] [6958] SSH 接続で通知する端末速度の値を設定可能にした。 #37598

scmno****@osdn***** scmno****@osdn*****
2017年 10月 24日 (火) 21:05:11 JST


Revision: 6958
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6958
Author:   doda
Date:     2017-10-24 21:05:11 +0900 (Tue, 24 Oct 2017)
Log Message:
-----------
SSH 接続で通知する端末速度の値を設定可能にした。 #37598

TELNET TERMINAL SPEED OPTION と共通の設定にする為、設定は [Tera Term]
セクションに置く。

設定例:

[Tera Term]
TerminalSpeed=38400		; In/Out 共に 38400bps
; TerminalSped=38400,9600	; In が38400bps, Out が 9600bps

注:
In/Out はサーバ側の TTY から見た物。
なので Tera Term からの送信が Input Speed、受信が Output Speed の
影響を受ける。(通常は気にする必要は無いはず)

Ticket Links:
------------
    http://sourceforge.jp/projects/ttssh2/tracker/detail/37598

Modified Paths:
--------------
    trunk/installer/release/TERATERM.INI
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/ttpset/ttset.c
    trunk/ttssh2/ttxssh/ssh.c

-------------- next part --------------
Modified: trunk/installer/release/TERATERM.INI
===================================================================
--- trunk/installer/release/TERATERM.INI	2017-10-24 09:40:50 UTC (rev 6957)
+++ trunk/installer/release/TERATERM.INI	2017-10-24 12:05:11 UTC (rev 6958)
@@ -661,6 +661,9 @@
 TCPLocalEcho=off
 TCPCRSend=
 
+; Terminal Speed (telnet/SSH)
+TerminalSpeed=38400
+
 ; Terminal Unique ID
 TerminalUID=FFFFFFFF
 

Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2017-10-24 09:40:50 UTC (rev 6957)
+++ trunk/teraterm/common/tttypes.h	2017-10-24 12:05:11 UTC (rev 6958)
@@ -678,6 +678,8 @@
 	WORD WaitCom;
 	WORD ListHiddenFonts;
 	char LogTimestampFormat[48];
+	int TerminalInputSpeed;
+	int TerminalOutputSpeed;
 };
 
 typedef struct tttset TTTSet, *PTTSet;

Modified: trunk/teraterm/ttpset/ttset.c
===================================================================
--- trunk/teraterm/ttpset/ttset.c	2017-10-24 09:40:50 UTC (rev 6957)
+++ trunk/teraterm/ttpset/ttset.c	2017-10-24 12:05:11 UTC (rev 6958)
@@ -2045,6 +2045,19 @@
 		}
 	}
 
+	// Terminal Speed (Used by telnet and ssh)
+	GetPrivateProfileString(Section, "TerminalSpeed", "38400", Temp, sizeof(Temp), FName);
+	GetNthNum(Temp,  1, &i);
+	if (i > 0)
+		ts->TerminalInputSpeed = i;
+	else
+		ts->TerminalInputSpeed = 38400;
+	GetNthNum(Temp,  2, &i);
+	if (i > 0)
+		ts->TerminalOutputSpeed = i;
+	else
+		ts->TerminalOutputSpeed = ts->TerminalInputSpeed;
+
 	// Fallback to CP932 (Experimental)
 	ts->FallbackToCP932 = GetOnOff(Section, "FallbackToCP932", FName, FALSE);
 
@@ -3380,6 +3393,15 @@
 	}
 	WritePrivateProfileString(Section, "ISO2022ShiftFunction", Temp, FName);
 
+	// Terminal Speed
+	if (ts->TerminalInputSpeed == ts->TerminalOutputSpeed) {
+		WriteInt(Section, "TerminalSpeed", FName, ts->TerminalInputSpeed);
+	}
+	else {
+		WriteInt2(Section, "TerminalSpeed", FName,
+			ts->TerminalInputSpeed, ts->TerminalOutputSpeed);
+	}
+
 	// CygTerm Configuration File
 	WriteCygtermConfFile(ts);
 }

Modified: trunk/ttssh2/ttxssh/ssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ssh.c	2017-10-24 09:40:50 UTC (rev 6957)
+++ trunk/ttssh2/ttxssh/ssh.c	2017-10-24 12:05:11 UTC (rev 6958)
@@ -7462,9 +7462,9 @@
 
 	// TTY mode\x82͂\xB1\x82\xB1\x82œn\x82\xB7 (2005.7.17 yutaka)
 	buffer_put_char(ttymsg, SSH2_TTY_OP_OSPEED);
-	buffer_put_int(ttymsg, 9600);  // baud rate
+	buffer_put_int(ttymsg, pvar->ts->TerminalOutputSpeed);  // baud rate
 	buffer_put_char(ttymsg, SSH2_TTY_OP_ISPEED);
-	buffer_put_int(ttymsg, 9600);  // baud rate
+	buffer_put_int(ttymsg, pvar->ts->TerminalInputSpeed);  // baud rate
 
 	// VERASE
 	buffer_put_char(ttymsg, SSH2_TTY_KEY_VERASE);
@@ -7505,7 +7505,8 @@
 	          "out-speed: %d, in-speed: %d, verase: %s, onlcr: %s",
 	          c->self_id, c->remote_id, req_type, pvar->ts->TermType,
 	          pvar->ssh_state.win_cols, pvar->ssh_state.win_rows, x, y,
-	          9600, 9600, (pvar->ts->BSKey==IdBS)?"^h":"^?", (pvar->ts->CRReceive==IdBS)?"on":"off");
+	          pvar->ts->TerminalOutputSpeed, pvar->ts->TerminalInputSpeed,
+	          (pvar->ts->BSKey==IdBS)?"^h":"^?", (pvar->ts->CRReceive==IdBS)?"on":"off");
 
 	pvar->session_nego_status = 2;
 



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