svnno****@sourc*****
svnno****@sourc*****
2009年 6月 16日 (火) 17:27:45 JST
Revision: 3503 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3503 Author: doda Date: 2009-06-16 17:27:45 +0900 (Tue, 16 Jun 2009) Log Message: ----------- Line at a timeモード時、Ctrl-U でカーソル位置を行頭に移動したあと行消去を行うようにした。 Modified Paths: -------------- trunk/teraterm/ttpcmn/ttcmn.c -------------- next part -------------- Modified: trunk/teraterm/ttpcmn/ttcmn.c =================================================================== --- trunk/teraterm/ttpcmn/ttcmn.c 2009-06-16 07:44:36 UTC (rev 3502) +++ trunk/teraterm/ttpcmn/ttcmn.c 2009-06-16 08:27:45 UTC (rev 3503) @@ -1612,7 +1612,7 @@ } } - if (d==0x0d) { + if (d==CR) { TempStr[TempLen++] = 0x0d; if (cv->CRSend==IdCRLF) { TempStr[TempLen++] = 0x0a; @@ -1622,6 +1622,16 @@ TempStr[TempLen++] = 0; } } + else if (d==0x15) { // Ctrl-U + if (cv->TelLineMode) { + // Move to top of line (CHA "\033[G") and erase line (EL "\033[K") + strncpy_s(TempStr, sizeof(TempStr), "\033[G\033[K", _TRUNCATE); + TempLen += 6; + } + else { + TempStr[TempLen++] = d; + } + } else if ((d>=0x80) && (cv->KanjiCodeEcho==IdUTF8 || cv->Language==IdUtf8)) { TempLen += OutputTextUTF8((WORD)d, TempStr, cv); } @@ -1699,7 +1709,8 @@ TempLen = 0; d = (BYTE)B[i]; - if (d==0x0d) { + switch (d) { + case CR: TempStr[TempLen] = 0x0d; TempLen++; if (cv->CRSend==IdCRLF) { @@ -1708,8 +1719,20 @@ else if (cv->CRSend==IdCR && cv->TelFlag && ! cv->TelBinSend) { TempStr[TempLen++] = 0; } - } - else { + break; + + case 0x15: // Ctrl-U + if (cv->TelLineMode) { + // Move to top of line (CHA "\033[G") and erase line (EL "\033[K") + strncpy_s(TempStr, sizeof(TempStr), "\033[G\033[K", _TRUNCATE); + TempLen += 6; + } + else { + TempStr[TempLen++] = d; + } + break; + + default: if ((cv->Language==IdRussian) && (d>=128)) { d = RussConv(cv->RussClient,cv->RussHost,d); }