GNU nano - Bugs: bug #61883, cancelling the overwriting of a...
You are not allowed to post comments on this tracker with your current authentication level.
bug #61883: cancelling the overwriting of a changed file at Exit does not cancel the exit
Submitter: | Tasos Papastylianou <tpapastylianou> | ||
Submitted: | Thu 20 Jan 2022 04:39:09 PM UTC | ||
Severity: | 3 - Normal | Status: | Fixed |
Assigned to: | bens | Open/Closed: | Closed |
Jump to the original submission
Thu 10 Feb 2022 09:10:21 AM UTC, comment #6: |
Benno Schulenberg <bens> |
Sat 22 Jan 2022 11:59:48 AM UTC, comment #5: Fixed in git, commit 1c074cc8, by staying at the filename prompt when the user Cancels (after having typed ^X Y <Enter>). Thanks for reporting the problem, and for confirming the fix.
|
Benno Schulenberg <bens> |
Sat 22 Jan 2022 12:09:05 AM UTC, comment #4: Dear Benno!
However, from a behavioural / linguistic point of view, the phrasing of the message shown can still trip the user very easily into pressing No when they should be pressing Cancel instead. Consider this scenario:
In other words, the phrasing "continue saving?" makes the user instinctively answer 'no', with the intent of aborting the 'overwriting'. But they end up "not saving and then proceeding to exit" instead, potentially losing important changes.
Also, as a minor thing. While the second patch seems more sensible, the comment on your first patch made it a lot easier for me to understand what was going on and follow the code. From a "help newbies read the code" point of view, it might be nice to add a comment or something next to what the choices do in that context :) e.g. :
|
Tasos Papastylianou <tpapastylianou> |
Fri 21 Jan 2022 03:13:49 PM UTC, comment #3: A better proposed patch is attached. |
Benno Schulenberg <bens> |
Fri 21 Jan 2022 02:34:59 PM UTC, comment #2: I think attached patch fixes the problem. Please try it out. |
Benno Schulenberg <bens> |
Fri 21 Jan 2022 11:17:37 AM UTC, comment #1: Hmm... I never get there because I always type ^S before typing ^X (or type ^X^Q when I don't want to keep the changes), so for me it hasn't started to exit and it just cancels the Save. I agree that in your case it ought to cancel the Exit, but... I don't know if that will be possible without major replumbing. |
Benno Schulenberg <bens> |
Thu 20 Jan 2022 04:39:09 PM UTC, original submission:
Assume the following scenario.
== Why is this the wrong behaviour? Programmatically, this behaviour makes sense. If you've reached the "save file?" dialogue, if you say 'no' or 'cancel', it will abort ONLY the 'save' action, and continue with what it was doing before, i.e. the 'exit' action. However, this is not meaningful in the above scenario. If you are about to save a file and you are confronted with the 'file has changed on disk' message, and you are not sure how, the most natural thing to want to do is to abort the exiting part (not just the saving part), and while nano is still open, attempt to save a backup under a different name, so that you can 'diff' this against the file on disk to see what changed and if it's worth keeping / merging the difference. As it is now, even if you press "Cancel", nano will still exit and you will lose all your unsaved changes. I would treat this behaviour as a bug. |
Tasos Papastylianou <tpapastylianou> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 9 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2022-02-10 | bens | Open/Closed | Open | Closed | |
Discussion Lock | Locked | None | |||
2022-01-22 | bens | Status | Ready For Test | Fixed | |
Discussion Lock | None | Locked | |||
2022-01-21 | bens | Attached File | - | Added 0001-files-let-C-cancel-the-exiting-when-the-file-on-disk.patch, #52704 | |
2022-01-21 | bens | Attached File | - | Added cancel-an-exit.patch, #52703 | |
Status | None | Ready For Test | |||
2022-01-21 | bens | Assigned to | None | bens | |
Summary | "Save at Exit" Cancel option does not cancel exit. | cancelling the overwriting of a changed file at Exit does not cancel the exit |
Powered by Savane 3.13-02a9.
Corresponding source code
Released in nano-6.1. Thank you for reporting!