13

I generally close tabs while using Eclipse with command+w, however, sometimes hit command+q by mistake. Even though I have Eclipse set-up to warn me when exiting (Preferences -> General -> Start-up and Shutdown, "Confirm exit when closing last window"), this shortcut seems to bypass the warning, which is quite annoying.

Is there a solution to this same as the way Chrome presents a warning when hitting this shortcut? A hack in some plist file maybe? Google searches have not helped much.

arin
  • 1,774
  • 22
  • 35
  • 1
    Command+q pops a confirmation dialog for me just fine (Indigo Release, JEE build). Are you positive your 'Confirm exit when closing last window' option is checked? – Perception Mar 30 '13 at 00:26
  • @Perception Yes, I should mention I am using Juno. – arin Mar 30 '13 at 01:11
  • Ok, I can confirm this behavior in Eclipse Juno SR2. I don't see anything in the release notes to indicate that this would be expected behavior. You might want to file a bug report. – Perception Mar 30 '13 at 01:31
  • Same here -- this is annoying! I've found several bugs reported on Eclipse with lengthy discussions but apparently no resolution! – Moos Jun 12 '13 at 21:10
  • Older Eclipse bugs: [bug 375744](https://bugs.eclipse.org/bugs/show_bug.cgi?id=375744), [bug 283345](https://bugs.eclipse.org/bugs/show_bug.cgi?id=283345). – Moos Jun 12 '13 at 21:17
  • This is similar to [bug 318177](https://bugs.eclipse.org/bugs/show_bug.cgi?id=318177), with two potential files to (save and then) delete, to see if the situation improves: - `/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi` - `/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs` – VonC Mar 30 '13 at 01:27
  • I can confirm this behavior in Kepler... just closed eclipse by mistake (cmd-q is just "one key away" from cmd-q)! Very annoying, any new concerning to this "bug" (there seem to be several bugs - some reported as fixed, some reopen - in eclipse bugs). – emgsilva Jul 05 '13 at 13:46

1 Answers1

12

OK, so having the same problem with Safari and doing a google search led me to this Apple discussions page. Basically following these steps (via @evenhuis) you can re-map the quit shortcut to any other menu function:

  1. Go to System Preference > Keyboard.
  2. Choose Keyboard Shortcuts
  3. Click Application Shortcuts
  4. Press the + button
  5. Under Application choose Eclipse
  6. For Menu Title input "Show All". (You could use some other innocuous menu option here)
  7. For Short Cut use ⌘Q
apricot
  • 3,599
  • 3
  • 19
  • 20
arin
  • 1,774
  • 22
  • 35
  • 1
    Excellent tip... however the "Bring All to Front" menu title did not work for me... but using the "Show All" (which is a option under the "Eclipse" menu - like the "quit") worked just perfect (maybe you should update the answer with that and mark it as completed)! Thank you for the tip! – emgsilva Oct 09 '13 at 12:22