svnno****@sourc*****
svnno****@sourc*****
2015年 11月 25日 (水) 20:02:41 JST
Revision: 6160 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6160 Author: doda Date: 2015-11-25 20:02:41 +0900 (Wed, 25 Nov 2015) Log Message: ----------- DECRQSS で DECSCUSR, DECSLRM に対応。 Modified Paths: -------------- trunk/teraterm/teraterm/vtterm.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/vtterm.c =================================================================== --- trunk/teraterm/teraterm/vtterm.c 2015-11-19 14:48:56 UTC (rev 6159) +++ trunk/teraterm/teraterm/vtterm.c 2015-11-25 11:02:41 UTC (rev 6160) @@ -3532,7 +3532,7 @@ void CSSpace(BYTE b) { switch (b) { - case 'q': + case 'q': // DECSCUSR if (ts.WindowFlag & WF_CURSORCHANGE) { if (NParam > 0) { switch (Param[1]) { @@ -3802,8 +3802,31 @@ { unsigned char RepStr[256]; int len = 0; + int tmp = 0; switch (StrBuff[0]) { + case ' ': + switch (StrBuff[1]) { + case 'q': // DECSCUSR + switch (ts.CursorShape) { + case IdBlkCur: + tmp = 1; + break; + case IdHCur: + tmp = 3; + break; + case IdVCur: + tmp = 5; + break; + default: + tmp = 1; + } + if (ts.NonblinkingCursor) { + tmp++; + } + len = _snprintf_s_l(RepStr, sizeof(RepStr), _TRUNCATE, "0$r%d q", CLocale, tmp); + } + break; case '"': switch (StrBuff[1]) { case 'p': // DECSCL @@ -3896,21 +3919,27 @@ len = _snprintf_s_l(RepStr, sizeof(RepStr), _TRUNCATE, "0$r%d;%dr", CLocale, CursorTop+1, CursorBottom+1); } break; + case 's': // DECSLRM + if (StrBuff[1] == 0) { + len = _snprintf_s_l(RepStr, sizeof(RepStr), _TRUNCATE, "0$r%d;%ds", CLocale, CursorLeftM+1, CursorRightM+1); + } + break; } - if (len > 0) { - if (ts.TermFlag & TF_INVALIDDECRPSS) { - RepStr[0] = '1'; + if (len == 0) { + if (strncpy_s(RepStr, sizeof(RepStr), "1$r", _TRUNCATE)) { + return; } - SendDCSstr(RepStr, len); + len = 3; } - else { - if (ts.TermFlag & TF_INVALIDDECRPSS) { - SendDCSstr("0$r", 0); + if (ts.TermFlag & TF_INVALIDDECRPSS) { + if (RepStr[0] == '0') { + RepStr[0] = '1'; } else { - SendDCSstr("1$r", 0); + RepStr[0] = '0'; } } + SendDCSstr(RepStr, len); } int toHexStr(unsigned char *buff, int buffsize, unsigned char *str)