Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add a confirm dialog before resetting terminal screen #1173

Closed
danowar2k opened this issue Oct 5, 2022 · 22 comments
Closed

Comments

@danowar2k
Copy link

I've just accidentally resetted my output when I wanted to click on Search but accidentally clicked on Reset in the context menu.

Would you be so kind as to add a confirm dialog before resetting the terminal?

@mintty
Copy link
Owner

mintty commented Oct 6, 2022

As xterm also has a Reset menu entry, unguarded function but better separated in the menu,
would it be sufficient to add another separator line between Search and Reset?

@danowar2k
Copy link
Author

I don't know, I can be awfully quick with clicking :-/

mintty added a commit that referenced this issue Oct 16, 2022
@mintty
Copy link
Owner

mintty commented Nov 14, 2022

Released 3.6.2.

@danowar2k
Copy link
Author

Thank you very much!

@ksufinger
Copy link

ksufinger commented Jan 26, 2023

Add the following line or modify the KeyFunctions setting in your .minttyrc file if you'd like to restore the previous Alt+F8 hotkey behavior (reset the terminal with no confirmation dialog). See the mintty manpage for more information.

KeyFunctions=A+F8:reset-noask

@dortamiguel
Copy link

Adding KeyFunctions=A+F8:reset-noask just disables resetting the terminal screen, how I can really get the original behaviour?

@mintty
Copy link
Owner

mintty commented Feb 5, 2023

It was quite annoying to get this changed by default...

(apparently deleted)
I'm sorry, a change is really rare but I thought the argument was quite convincing. Open to discussion though.
(Note: Another change that I considered but didn't do was to enable Control as a Compose key be default...)

The KeyFunctions assignment works here, puzzled about that; does Control+V Alt+F8 report anything? Please upload your full config file.

@dortamiguel
Copy link

I think is fine no worries, I thought I broke something because I got that message. But it seems like an easy fix, though it seems to not work for me...

this my config now

Font=SF Mono
FontHeight=15
FontWeight=400
FontIsBold=no
BellType=0
BellTaskbar=no
ConfirmExit=no
CursorType=block
ClipShortcuts=yes
CopyOnSelect=no
CopyAsRTF=no
TrimSelection=no
ClearSelectionOnInput=no

CursorColour=255,180,116
BackgroundColour=44,70,97
ForegroundColour=255,255,255
Black=0,0,0
BoldBlack=126,126,127
Red=255,101,80
BoldRed=241,94,75
Green=115,255,186
BoldGreen=108,243,178
Yellow=255,160,81
BoldYellow=242,152,77
Blue=94,203,255
BoldBlue=92,192,243
Magenta=235,176,255
BoldMagenta=255,168,243
Cyan=163,221,254
BoldCyan=156,208,243
White=255,255,255
BoldWhite=255,255,255

@mintty
Copy link
Owner

mintty commented Feb 5, 2023

That config does not contain a KeyFunctions setting, so it cannot work.

@dortamiguel
Copy link

Ah sorry, I forgot to say that when I add KeyFunctions=A+F8:reset-noask is when it stops working.

Without that line I get the confirmation message, with that line nothing happens

@mintty
Copy link
Owner

mintty commented Feb 6, 2023

So Alt+F8 does not clear your screen? I have no idea why.

@dortamiguel
Copy link

It clears the screen if I don't add the KeyFunctions=A+F8:reset-noask but then I get the dialog confirmation

@mintty
Copy link
Owner

mintty commented Feb 6, 2023

Did you, by any chance, manage to put a Windows lineend (CRLF) behind that line?
Try to add a semicolon to its end:
KeyFunctions=A+F8:reset-noask;

@mintty
Copy link
Owner

mintty commented Feb 14, 2023

Does the semicolon help?

@clayne
Copy link

clayne commented Apr 3, 2023

Is there any chance we can revert this or make the default to be no confirm and otherwise provide an option for people who want that type of thing? I find myself using the "reset terminal" feature quite a bit and it's a bit jarring to flip expected behavior just because one person made a non-fatal mistake once. And yeah, I could just use the keyboard shortcut, which I'm slowly reversing muscle memory for, but it's more about the principle of adding interactivity to something that just simply does not need it and slows people down 99% of the time for the 1% odd case.

@mintty mintty reopened this Apr 4, 2023
@danowar2k
Copy link
Author

Please don't revert, but I'm totally okay with the default being not to ask and it being a config or UI setting :-)

@clayne
Copy link

clayne commented Apr 4, 2023

Yes, I think it's fine to offer a UI option - but IMO to immediately slap a safety guard on something because 0.1% of the userbase shot themselves in the foot with it isn't the right approach. That's turtles all the way down.

@BrianInglis
Copy link

It's a safety net for 99% of the users who did not mean to invoke a terminal reset, and for which it is likely to make no difference.
But in most cases, we never want a reset to occur without confirmation, otherwise it could be used by malicious code.
If someone clicks or presses enter without thinking or reading, that is not our issue, nor if someone wants to allow code to reset their terminal indiscriminately: not a safe approach!

@clayne
Copy link

clayne commented Apr 4, 2023

This is about a GUI dialog option asking for confirm - not about "malicious code" resetting the terminal, of which I'm pretty sure the added confirm dialog isn't even involved with. It's a safety net optimizing for a scenario where a user clicks "Reset Terminal" in a specific context menu that they pulled up and 0.1% of the time that not actually being what they wanted to do - where the "negative" cost of that happening is merely that their scrollback buffer was cleared - a completely non-destructive situation. Meanwhile the majority of people who intentionally use it to clear scrollback buffers now have to mindlessly grab the mouse and click on a newly added confirm dialog that in the grand scheme of things is likely costing people more time than it's saving them from.

@danowar2k
Copy link
Author

You people should cool down, the current tone is very unfriendly...

@mintty
Copy link
Owner

mintty commented Apr 6, 2023

Clear scrollback is also available as a separate menu item, by the way.
I do intend to add an option, surprisingly it's just a bit tricky due to the way this is implemented in mintty.
Design issues: Should there be separate configuration (bits) for Alt+F8 and Ctrl+Shift+R? What should be the default?

@mintty
Copy link
Owner

mintty commented Sep 3, 2023

Release 3.6.5.

@mintty mintty closed this as completed Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants