19

Anyone know if I can have visual studio prompt me if I really want to close it (I believe Eclipse prompts before closing)? Or some other way of stopping it from closing when I hit the "X".

Thanks

EDIT: To clarifybasically I wanted this b/c I have attempt to close an app that is in the foreground but accidentally closed VS b/c the other app was not maximized. VS can be rather slow to start up on my development machine (initialization of a couple of addin's and toolkits slow it down a fair bit).

In terms if annoying messages, I can understand that, but it could be an option (turned off by default) or you could be asked this question once and allowed to opt out from then on. This is exactly what Eclipse does.

In terms of my acceptance rate ... I can't defend that. I should be going back and accepting or clarifying my questions and will try to do so in the future.

  • 1
    Isn't that like asking someone if they can make and stove burner that won't hurt if it's on and you touch it. – Matthew Whited Jun 21 '10 at 16:03
  • 1
    I understand why you want it. I wish I knew how to do that. And I only want the functionality because sometimes I double-click the close button on an application and it closes Visual Basic too since that X is behind the applications X. – Kyra Jun 21 '10 at 16:06
  • 1
    VS asks you to save when you have unsaved changes. Normally that does it. – Tim Schmelter Jun 21 '10 at 16:07
  • @Kyra, since when does Windows require you to "double click" the close button. It's a one-click event, no need for a second click. – Chase Florell Jun 21 '10 at 16:09
  • 3
    At the same time... how many of us have been annoyed by the app that asked about 3+ times before you exit. "Click here to exit", "Are you sure you want to exit?", "Do you want to change your changes?" – Matthew Whited Jun 21 '10 at 16:16
  • I personally like this behavior. The title bar of VS has the name of the solution, so that makes easy ID. If your solution names suck, there is a field called friendly name that you can change and the title bar will reflect that friendly name. – surfasb Jan 04 '12 at 17:42
  • My name is Arrogant Commenter and I think we should not use tools like Resharper because common sense tells you to just write perfect code. Common sense wants you to read books and to follow library help instead of searching for answers on SO. – leye0 Nov 07 '14 at 18:43
  • 4
    so many people hating on this idea... I ask - how much does it suck when you accidentally close (you have multiple windows open, and click the wrong X), and then have to reload your entire solution? For that reason, Eclipse has this – Don Cheadle Nov 29 '16 at 04:26

3 Answers3

4

There are some utilities that allow you to do this for any application. For example, see http://www.donationcoder.com/Software/Skrommel/index.html#NoClose

  • 1
    +1 for a correct answer - though I still fail to see the reasoning for this feature. Common sense should always prevail over software hacks. – Chase Florell Jun 21 '10 at 16:10
  • 1
    Well, people have different tastes. In KDE every app that stays in systray asks you if you really want to exit when right-clicking the icon and choosing Exit. For me it was always annoying, but the dialog has a nice checkbox "Do not ask again". Every dialog should have such a checkbox! :) –  Jun 21 '10 at 16:16
  • Btw, I too often happen to close VS accidentally, but even more times VS closes itself without me wanting it (crashing) :) –  Jun 21 '10 at 16:18
  • 2
    It's usually not about common sense but about accidental clicking. If you go to restore or maximize and you click the wrong thing because you are moving quickly, it's an easy mistake to make. –  Jun 21 '10 at 20:36
  • 1
    This workaround doesn't work for VS2012 anymore since it has custom designed box controls. Anyone has a solution for that? – Koen Oct 30 '12 at 23:33
  • 1
    it's not working on VS2017 – M.R.Safari May 20 '17 at 09:13
  • @ChaseFlorell - Accidental closures happen to me way too often with multiple-screen setups. – anon Aug 23 '19 at 16:12
3

This works in newer versions of Visual Studio:

https://marketplace.visualstudio.com/items?itemName=NikolayBelyh.ClosePrompt2017

anon
  • 487
1

This setting will warn you when you exit and having an active terminal (which is usually the case for "an accident close")

"terminal.integrated.confirmOnExit": "always"

enter image description here