Skip to content

Commit

Permalink
guard confirm dialog on interactive reset (#1173), option ConfirmReset
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Apr 21, 2023
1 parent fd7e04e commit c76c7e5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion docs/mintty.1
Original file line number Diff line number Diff line change
Expand Up @@ -2376,6 +2376,11 @@ This is intended to help avoid closing programs accidentally.
If possible, mintty also displays a list of running child processes,
using the procps command if installed, or the ps command.

.TQ
\fBPrompt to confirm interactive reset\fP (ConfirmReset=no)
If enabled, ask for confirmation when a terminal reset is requested
interactively via \fIAlt+F8\fP or from the menu.

.TQ
\fBSuppress properties and features controlled by escape sequences\fP
Using these options, the listed feature numbers are suppressed.
Expand Down Expand Up @@ -3067,7 +3072,7 @@ Supported actions are described as follows:
.br
\(en \fBlock-title\fP: locks the window title from being changed
.br
\(en \fBreset\fP: resets the terminal (with confirm dialog)
\(en \fBreset\fP: resets the terminal (with confirm dialog if enabled)
.br
\(en \fBreset-noask\fP: resets the terminal (no confirm dialog)
.br
Expand Down
2 changes: 2 additions & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ const config default_cfg = {
.play_tone = 2,
.printer = W(""),
.confirm_exit = true,
.confirm_reset = false,
// Command line
.class = W(""),
.hold = HOLD_START,
Expand Down Expand Up @@ -505,6 +506,7 @@ options[] = {
{"PlayTone", OPT_INT, offcfg(play_tone)},
{"Printer", OPT_WSTRING, offcfg(printer)},
{"ConfirmExit", OPT_BOOL, offcfg(confirm_exit)},
{"ConfirmReset", OPT_BOOL, offcfg(confirm_reset)},

// Command line
{"Class", OPT_WSTRING, offcfg(class)},
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ typedef struct {
int play_tone;
wstring printer;
bool confirm_exit;
bool confirm_reset;
// Command line
wstring class;
char hold;
Expand Down
2 changes: 1 addition & 1 deletion src/winmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -3615,7 +3615,7 @@ static struct {
when IDM_PASTE: win_paste();
when IDM_SELALL: term_select_all(); win_update(false);
when IDM_RESET or IDM_RESET_NOASK:
if ((wp & ~0xF) == IDM_RESET_NOASK || confirm_reset()) {
if ((wp & ~0xF) == IDM_RESET_NOASK || !cfg.confirm_reset || confirm_reset()) {
winimgs_clear();
term_reset(true);
win_update(false);
Expand Down
1 change: 1 addition & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Terminal features
Configuration
* New user-definable function compose (#1211).
* New option setting ComposeKey=capslock (#1211).
* New option ConfirmReset to guard confirm dialog on interactive reset (#1173).

### 3.6.4 (25 Mar 2023) ###

Expand Down

0 comments on commit c76c7e5

Please sign in to comment.