Skip to content

Commit

Permalink
Send file 時 local echo 設定を反映するよう修正 #393
Browse files Browse the repository at this point in the history
- "Tera Term 4 と同じ方法で送信"=OFF 時
- Terminal tab - Local echo の設定
- file - send file... はローカルエコー設定を反映するようにした
  - "Tera Term 4 と同じ方法で送信" は反映するようになっていた
- 次のファイル送信も local echo 設定を反映するようにした
  - sendfile マクロコマンド
  - Drag and Drop でのファイルの内容送信
  • Loading branch information
zmatsuo committed Nov 28, 2024
1 parent bcf53d1 commit 7c731e1
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 17 deletions.
7 changes: 7 additions & 0 deletions doc/en/html/about/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ <h3 id="teraterm_5.4">YYYY.MM.DD (Ver 5.4 not released yet)</h3>
<li>Fixed display characters containing surrogate pair character when "<a href="../menu/setup-additional-font.html#ResizedFont">Drawing resized font to fit cell width</a>"
<li>MACRO: Fixed <a href="../macro/command/getenv.html">getenv</a>, <a href="../macro/command/expandenv.html">expandenv</a> and <a href="../macro/command/setenv.html">setenv</a> macro commands were not Unicode-compatible.</li>
<li>Fixed B-plus send is not working</li>
<li>Fixed local echo setting was not used:
<ul>
<li>Send file (<a href="../menu/file-sendfile.html">file - Send file</a>)</li>
<li>Send file (<a href="../usage/mouse.html#SendFile">Drop File</a>)</li>
<li><a href="../macro/command/sendfile.html">sendfile</a> macro command</li>
</ul>
</li>
</ul>
</li>

Expand Down
2 changes: 1 addition & 1 deletion doc/en/html/usage/mouse.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ <h2>
</dd>
</dl>
</dd>
<dt>Send File (Paste content of file)</dt>
<dt id="SendFile">Send File (Paste content of file)</dt>
<dd>
The file content is sent(pasted) into the terminal.<br>
When the file is dropped, this menu can be selected with the file. <br>
Expand Down
7 changes: 7 additions & 0 deletions doc/ja/html/about/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ <h3 id="teraterm_5.4">YYYY.MM.DD (Ver 5.4 not released yet)</h3>
<li>"<a href="../menu/setup-additional-font.html#ResizedFont">Drawing resized font to fit cell width</a>" が on のとき、サロゲートペアの文字が存在したとき正しく表示するよう修正した。</li>
<li>MACRO: <a href="../macro/command/getenv.html">getenv</a>, <a href="../macro/command/expandenv.html">expandenv</a>, <a href="../macro/command/setenv.html">setenv</a> マクロコマンド が Unicode に対応していなかったので修正した。</li>
<li>B-Plusの送信ができなくなっていたので修正した。</li>
<li>次の時 local echo 設定を反映していなかったので修正した。
<ul>
<li>ファイル送信 (<a href="../menu/file-sendfile.html">file - Send file</a>)</li>
<li>ファイル送信 (<a href="../usage/mouse.html#SendFile">Drop File</a>)</li>
<li><a href="../macro/command/sendfile.html">sendfile</a> マクロコマンド</li>
</ul>
</li>
</ul>
</li>

Expand Down
2 changes: 1 addition & 1 deletion doc/ja/html/usage/mouse.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ <h2>
</dd>
</dl>
</dd>
<dt>Send File (Paste content of file)</dt>
<dt id="SendFile">Send File (Paste content of file)</dt>
<dd>
ファイルの内容を端末内に送信(ペースト)します。<br>
ドロップ内容がファイルだけのとき選択できます。<br>
Expand Down
12 changes: 7 additions & 5 deletions teraterm/teraterm/sendmem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ BOOL SendMemSendFile(const wchar_t *filename, BOOL binary, SendMemDelayType dela
return r;
}
#else
SendMem *SendMemSendFileCom(const wchar_t *filename, BOOL binary, SendMemDelayType delay_type, DWORD delay_tick, size_t send_max)
SendMem *SendMemSendFileCom(const wchar_t *filename, BOOL binary, SendMemDelayType delay_type, DWORD delay_tick, size_t send_max, BOOL local_echo)
{
SendMem *sm;
if (!binary) {
Expand Down Expand Up @@ -743,20 +743,22 @@ SendMem *SendMemSendFileCom(const wchar_t *filename, BOOL binary, SendMemDelayTy
SendMemInitDialogCaption(sm, L"send file"); // title
SendMemInitDialogFilename(sm, filename);
SendMemInitDelay(sm, delay_type, delay_tick, send_max);
SendMemInitEcho(sm, local_echo);

SendMemStart(sm);
return sm;
}
#endif

BOOL SendMemSendFile(const wchar_t *filename, BOOL binary, SendMemDelayType delay_type, DWORD delay_tick, size_t send_max)
BOOL SendMemSendFile(const wchar_t *filename, BOOL binary, SendMemDelayType delay_type, DWORD delay_tick, size_t send_max, BOOL local_echo)
{
SendMem *sm = SendMemSendFileCom(filename, binary, delay_type, delay_tick, send_max);
SendMem *sm = SendMemSendFileCom(filename, binary, delay_type, delay_tick, send_max, local_echo);
return (sm != NULL) ? TRUE : FALSE;
}

BOOL SendMemSendFile2(const wchar_t *filename, BOOL binary, SendMemDelayType delay_type, DWORD delay_tick, size_t send_max, void (*callback)(void *data), void *callback_data)
BOOL SendMemSendFile2(const wchar_t *filename, BOOL binary, SendMemDelayType delay_type, DWORD delay_tick, size_t send_max, BOOL local_echo, void (*callback)(void *data), void *callback_data)
{
SendMem *sm = SendMemSendFileCom(filename, binary, delay_type, delay_tick, send_max);
SendMem *sm = SendMemSendFileCom(filename, binary, delay_type, delay_tick, send_max, local_echo);
if (sm == NULL) {
return FALSE;
}
Expand Down
4 changes: 2 additions & 2 deletions teraterm/teraterm/sendmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ void SendMemContinuously(void);

// convenient function
BOOL SendMemPasteString(wchar_t *str);
BOOL SendMemSendFile(const wchar_t *filename, BOOL binary, SendMemDelayType delay_type, DWORD delay_tick, size_t send_max);
BOOL SendMemSendFile2(const wchar_t *filename, BOOL binary, SendMemDelayType delay_type, DWORD delay_tick, size_t send_max, void (*callback)(void *data), void *callback_data);
BOOL SendMemSendFile(const wchar_t *filename, BOOL binary, SendMemDelayType delay_type, DWORD delay_tick, size_t send_max, BOOL local_echo);
BOOL SendMemSendFile2(const wchar_t *filename, BOOL binary, SendMemDelayType delay_type, DWORD delay_tick, size_t send_max, BOOL local_echo, void (*callback)(void *data), void *callback_data);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion teraterm/teraterm/ttdde.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ static HDDEDATA AcceptExecute(HSZ TopicHSz, HDDEDATA Data)
BOOL r = FileSendStart(ParamFileNameW, ParamBinaryFlag);
#else
// 5 で追加した方法で送信
BOOL r = SendMemSendFile2(ParamFileNameW, ParamBinaryFlag, 0, 0, 0, SendCallback, NULL);
BOOL r = SendMemSendFile2(ParamFileNameW, ParamBinaryFlag, SENDMEM_DELAYTYPE_NO_DELAY, 0, 0, ts.LocalEcho, SendCallback, NULL);
#endif
free(ParamFileNameW);
if (r) {
Expand Down
10 changes: 3 additions & 7 deletions teraterm/teraterm/vtwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1770,12 +1770,8 @@ LRESULT CVTWindow::OnDropNotify(WPARAM ShowDialog, LPARAM lparam)
// cancel
break;
case DROP_TYPE_SEND_FILE: {
if (!data->TransBin) {
SendMemSendFile2(FileName, FALSE, SENDMEM_DELAYTYPE_NO_DELAY, 0, 0, DropSendCallback, data);
}
else {
SendMemSendFile2(FileName, TRUE, SENDMEM_DELAYTYPE_NO_DELAY, 0, 0, DropSendCallback, data);
}
const BOOL binary = data->TransBin ? TRUE : FALSE;
SendMemSendFile2(FileName, binary, SENDMEM_DELAYTYPE_NO_DELAY, 0, 0, ts.LocalEcho, DropSendCallback, data);
break;
}
case DROP_TYPE_PASTE_FILENAME:
Expand Down Expand Up @@ -3996,7 +3992,7 @@ void CVTWindow::OnFileSend()
wchar_t *filename = data.filename;
if (!data.method_4) {
// new file send
SendMemSendFile(filename, data.binary, data.delay_type, data.delay_tick, data.send_size);
SendMemSendFile(filename, data.binary, data.delay_type, data.delay_tick, data.send_size, ts.LocalEcho);
}
else {
// file send same as teraterm 4
Expand Down

0 comments on commit 7c731e1

Please sign in to comment.