macvim-dev / macvim-dev/macvim

`macaction terminate:` (also quit via Cmd-q/logout/reboot) ignores `set confirm`

Open
#1,579 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
7.9k
Forks
691
PR merge metrics
No merged PRs in 30d

Description

Steps to reproduce
  1. Run set confirm
  2. Create a few buffers with unsaved changes (doesn't matter if the buffers are backed by files or not).
  3. Run command macaction terminate:, or press Cmd-Q, or reboot machine.
Expected behaviour

The setting set confirm should prompt for each unsaved buffer whether you are okay with discarding changes. However, macaction terminate: completely ignores this setting, and just shows a dialog that doesn't mention any file names:

Quit without saving?

There are modified buffers, if you quit now all changes will be lost. Quit anyway?

It appears that macaction terminate: skips a lot of normal Vim exit code as well - autocommands like VimLeavePre do not run.

Version of MacVim

r181

MacVim installation method

GitHub release

Environment

macOS 15.4.1 Sequoia

Logs and stack traces
N/A
Vim and MacVim configuration where issue is reproducable

Doesn't appear to depend on config. I tested both with mvim --clean and my usual config, https://github.com/telotortium/vimrc

How was MacVim launched?
  • by launching MacVim.app in macOS (by using the Dock, Spotlight, or the open command)
  • by running mvim/gvim in the terminal
Issue has been tested with clean configuration
  • by running mvim --clean (or gvim, supplied by MacVim distribution). You can also use the File → "New Clean Window" menu item within MacVim.
  • by running vim --clean (in terminal, supplied by MacVim distribution)
  • by running vim --clean (in terminal, other suppliers, e.g. /usr/bin/vim)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the macaction terminate: handling and compare it with the normal Vim exit path, using the reported Cmd-Q and logout/reboot paths as reproduction cases. Reproduce with mvim --clean, set confirm, and unsaved buffers; done when each buffer is confirmed and VimLeavePre runs during termination.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, vim
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.