Skip to content

Commit

Permalink
Merge pull request #176 from sempreff/feature/DisableIniAutoBackup
Browse files Browse the repository at this point in the history
allow users to select create backup or not
  • Loading branch information
nmaya authored Mar 20, 2024
2 parents 8d63898 + 1df249c commit c23ca86
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/en/html/about/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ <h3 id="teraterm_5.3">YYYY.MM.DD (Ver 5.3 not released yet)</h3>
<li>MACRO: When TTL file is relative path, it is relative from current directory of ttpmacro.</li>
<li>Use EnableContinuedLineCopy setting when dragging after selecting a word by double click.</li>
<li>Show error messagebox when logging cannot be started with LogAutoStart=on</li>
<li>allow users to select creating automatic backup or not by <a href="../setup/teraterm-misc.html#IniAutoBackup">IniAutoBackup</a> when overwriting the ini file.
</ul>
</li>

Expand Down
6 changes: 6 additions & 0 deletions doc/en/html/setup/teraterm-ini.html
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,12 @@ <h2>Tera Term</h2>
<td style="width:250px;">off</td>
<td></td>
</tr>
<tr>
<td id="IniAutoBackup"><a href="teraterm-misc.html#IniAutoBackup">IniAutoBackup</a></td>
<td style="width:250px;">on</td>
<td style="width:250px;">&lt;-</td>
<td></td>
</tr>
<tr>
<td id="EnableLineMode"><a href="teraterm-com.html#linemode">EnableLineMode</a></td>
<td style="width:250px;">on</td>
Expand Down
16 changes: 16 additions & 0 deletions doc/en/html/setup/teraterm-misc.html
Original file line number Diff line number Diff line change
Expand Up @@ -427,5 +427,21 @@ <h1 id="HighDPI">High DPI Aware</h1>
Tera Term is using the Per-monitor DPI awareness V2 feature that is supported on the Windows 10 Version 1703 or later. For more details of the Per-monitor DPI awareness V2, see the <a href="https://blogs.windows.com/buildingapps/2017/04/04/high-dpi-scaling-improvements-desktop-applications-windows-10-creators-update/" target="_blank"> High-DPI Scaling Improvements for Desktop Applications in the Windows 10 Creators Update (1703)</a>.
</p>

<h1 id="IniAutoBackup">Auto backup of Tera Term setup file</h1>

<p>
When overwriting an existing setup file, a backup file is created automatically.
If you do not need a backup file, change the IniAutoBackup entry of [Tera Term] section as the following:
</p>

<pre>
IniAutoBackup=off
</pre>

<pre>
Default:
IniAutoBackup=on
</pre>

</BODY>
</HTML>
1 change: 1 addition & 0 deletions doc/ja/html/about/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ <h3 id="teraterm_5.3">YYYY.MM.DD (Ver 5.3 not released yet)</h3>
<li>MACRO: TTLファイルを相対パスで指定したとき、ttpmacroのカレントディレクトリ相対で扱うようにした。</li>
<li>ダブルクリックでワード選択後のドラッグ時、EnableContinuedLineCopy を反映してするようにした。</li>
<li>LogAutoStart=on でログ記録が開始できないとき、エラーメッセージを表示するようにした。</li>
<li>iniファイルを上書きする際に自動バックアップを作成するかどうかを <a href="../setup/teraterm-misc.html#IniAutoBackup">IniAutoBackup</a> で設定できるようにした。</li>
</ul>
</li>

Expand Down
6 changes: 6 additions & 0 deletions doc/ja/html/setup/teraterm-ini.html
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,12 @@ <h2>Tera Term</h2>
<td style="width:250px;">off</td>
<td></td>
</tr>
<tr>
<td id="IniAutoBackup"><a href="teraterm-misc.html#IniAutoBackup">IniAutoBackup</a></td>
<td style="width:250px;">on</td>
<td style="width:250px;">&lt;-</td>
<td></td>
</tr>
<tr>
<td id="EnableLineMode"><a href="teraterm-com.html#linemode">EnableLineMode</a></td>
<td style="width:250px;">on</td>
Expand Down
16 changes: 16 additions & 0 deletions doc/ja/html/setup/teraterm-misc.html
Original file line number Diff line number Diff line change
Expand Up @@ -456,5 +456,21 @@
Creators Update (1703)</a>を参照ください。
</p>

<h1 id="IniAutoBackup">設定ファイルの自動バックアップ</h1>

<p>
既存の設定ファイルに上書きする場合、バックアップファイルが自動的に作られます。
自動バックアップが不要であれば、設定ファイルの [Tera Term] セクションの IniAutoBackup 行を以下のように変更してください。
</p>

<pre>
IniAutoBackup=off
</pre>

<pre>
Default:
IniAutoBackup=on
</pre>

</BODY>
</HTML>
1 change: 1 addition & 0 deletions installer/release/TERATERM.INI
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ UnicodeEmojiOverride=
UnicodeEmojiWidth=
FallbackToCP932=off
DrawingResizedFont=on
IniAutoBackup=on
[TTSSH]
; SSH enabled flag (1=enabled 0=disabled)
Expand Down
1 change: 1 addition & 0 deletions teraterm/common/tttypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ struct tttset {
wchar_t *LogDefaultNameW;
BOOL Dec2Unicode;
wchar_t *DelimListW;
WORD IniAutoBackup;

// Experimental
BYTE ExperimentalTreeProprtySheetEnable;
Expand Down
6 changes: 4 additions & 2 deletions teraterm/teraterm/vtwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4623,8 +4623,10 @@ void CVTWindow::OnSetupSave()

if (wcscmp(PrevSetupFNW, ts.SetupFNameW) == 0) {
// 同名ファイルへ書き込み(上書き)
// バックアップを作成
CreateBakupFile(ts.SetupFNameW, NULL);
if (ts.IniAutoBackup) {
// バックアップを作成
CreateBakupFile(ts.SetupFNameW, NULL);
}
}
else {
// 異なるファイルへ書き込み
Expand Down
6 changes: 6 additions & 0 deletions teraterm/ttpset/ttset.c
Original file line number Diff line number Diff line change
Expand Up @@ -2088,6 +2088,9 @@ void PASCAL _ReadIniFile(const wchar_t *FName, PTTSet ts)

ts->Dec2Unicode = FALSE;

// 自動バックアップ
ts->IniAutoBackup = GetOnOff(Section, "IniAutoBackup", FName, TRUE);

// Experimental
ts->ExperimentalTreeProprtySheetEnable = GetOnOff("Experimental", "TreeProprtySheet", FName, FALSE);
ts->ExperimentalDontUseFontDialog = GetOnOff("Experimental", "DontUseFontDialog", FName, FALSE);
Expand Down Expand Up @@ -3315,6 +3318,9 @@ void PASCAL _WriteIniFile(const wchar_t *FName, PTTSet ts)

// 通知音
WriteOnOff(Section, "NotifySound", FName, ts->NotifySound);

// 自動バックアップ
WriteOnOff(Section, "IniAutoBackup", FName, ts->IniAutoBackup);
}

void PASCAL _CopySerialList(const wchar_t *IniSrc, const wchar_t *IniDest, const wchar_t *section,
Expand Down

0 comments on commit c23ca86

Please sign in to comment.