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

[CLOSED] Mac: Brackets won't quit in subsequent sessions after using Dev Tools #5473

Open
core-ai-bot opened this issue Aug 30, 2021 · 28 comments

Comments

@core-ai-bot
Copy link
Member

Issue by couzteau
Thursday Nov 14, 2013 at 00:56 GMT
Originally opened as adobe/brackets#5989


  1. Run brackets
  2. open test runner chrome debug tools
  3. quit brackets
  4. restart brackets.
  5. Now brackets won’t quit unless I run quit from the OSX dock.

results:
At step 3 I'd expect my chrome dev tools to close. But they stay open
At step 5 I'd expect brackets to quit via CMD-Q or via Quit from menu

Env OSX 10.7, 10.8, 10.9


Slightly simplified steps:

  1. Run Brackets
  2. Debug > Show Developer Tools
  3. Close Brackets
  4. Do not close Chrome
  5. Restart Brackets
  6. Cmd-Q

Results:
Bracket won't quit

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Thursday Nov 14, 2013 at 01:06 GMT


I'm seeing this too on 10.7. But in step 2 I don't open the unit test window, I just go straight to Debug > Show Developer Tools.

@core-ai-bot
Copy link
Member Author

Comment by JeffryBooher
Thursday Nov 14, 2013 at 01:07 GMT


@jasonsanjose are you running OSX 10.9 as well? Just wondering if it's something new with 10.9

@core-ai-bot
Copy link
Member Author

Comment by JeffryBooher
Thursday Nov 14, 2013 at 01:08 GMT


N/M@jasonsanjose -- I see you e-mail now that you see it on 10.7

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Thursday Nov 14, 2013 at 01:36 GMT


@redmunds would this closed PR fix this? adobe/brackets-shell#374

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 01:39 GMT


@fungl164 Can you take a look at this one? I'm wondering if it has something to do with your recent Chrome changes.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 01:41 GMT


@jasonsanjose I was just trying that. I'm not sure why, but Dev Tools still open in Chrome live-dev profile with that branch (randy/dev-tools-no-debug-connection), so problem is not fixed.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 01:49 GMT


Doh! I forgot to rebuild. That branch does fix it if Chrome is not running, but Dev Tools fail to launch if Chrome is already running. I'll play around with it.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Thursday Nov 14, 2013 at 02:02 GMT


Updated title to clarify that this only occurs in dev tools related workflows.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 02:15 GMT


I can also hit problem with this scenario:

  1. Open Brackets
  2. Start Live Dev
  3. In Chrome window with Live Dev (i.e. live-dev profile), open a new Tab
  4. In new Tab, go to localhost:9234 and click on the Dev Tools link
  5. Close and restart Brackets

So, opening Dev Tools in Chrome with default profile may not be enough to fix this problem because you can manually open Dev Tools in Chrome window with live-dev profile.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 02:22 GMT


Note that this only happens on Mac.

When I try to reproduce on Windows, when Brackets is shutdown, I see a message in Chrome Dev Tools window: "Detached from Target. Remote Debugging has been terminated with reason target_closed. Please re-attach to new target".

I don't see that message in Chrome window on Mac.

@core-ai-bot
Copy link
Member Author

Comment by fungl164
Thursday Nov 14, 2013 at 02:59 GMT


@redmunds et al. I'm on #brackets irc if you want to chat...

@core-ai-bot
Copy link
Member Author

Comment by fungl164
Thursday Nov 14, 2013 at 14:44 GMT


Based on the symptoms and behavior, I believe the problem is most likely that the native app is for some reason not closing the main window. I'm not sure if this is the proper place to force quit the app on exit, but if seems to fix the problem. see (https://github.com/fungl164/brackets-shell/tree/devtools-close)

@core-ai-bot
Copy link
Member Author

Comment by fungl164
Thursday Nov 14, 2013 at 14:47 GMT


@redmunds this should work without any changes to the current master (e.g. no gist edits)

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 16:46 GMT


@fungl164 Thanks for continuing to look at this. The problem is definitely that Brackets is not properly terminating.

Unfortunately your suggestion won't work in the case where there are unsaved documents at shutdown. Instead of prompting user to save documents, it shuts down immediately so unsaved changes are lost.

@core-ai-bot
Copy link
Member Author

Comment by fungl164
Thursday Nov 14, 2013 at 17:15 GMT


@redmunds is there some code already available that can be called to ensure files are saved (either in the appshell or in brackets)?

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 17:17 GMT


@fungl164 Yes, but it's getting caught in the infinite messaging loop, so it never makes it to termination.

@core-ai-bot
Copy link
Member Author

Comment by fungl164
Thursday Nov 14, 2013 at 17:19 GMT


@redmunds which loop? can you point me to it?

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Thursday Nov 14, 2013 at 17:30 GMT


Do we need to go so far as specifically opening Chrome for dev tools?

Looking at the old sprint 33 code, we don't need any of the flags that we used to pass:

--remote-debugging-port=9222 
--allow-file-access-from-files

And in sprint 34, we certainly don't need --temp-profile. Couldn't we get away with something simpler:

[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://localhost:9234"]];

It seems like overkill for brackets.app.showDeveloperTools to go through the same hoops as opening live preview URLs.

Only brackets devs and extension authors will use dev tools. Given that assumption, it's not a terrible experience for those targeted users to end up in the wrong browser if they happen to not use Chrome or Safari as their default browser.

@core-ai-bot
Copy link
Member Author

Comment by fungl164
Thursday Nov 14, 2013 at 17:35 GMT


@jasonsanjose we tried that last night.

The problem comes down to how the shared workspace chooses the browser instance to open the URL arg. It basically picks the last active window, so if the LiveDev instance had the last focus, we still have the same problem.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 17:39 GMT


@fungl164 It's not a simple loop. brackets-shell sends FILE_CLOSE_WINDOW message to brackets, which ultimately either returns with FILE_CLOSE or APP_ABORT_QUIT (but I may have the order reversed). In the middle of this process may be other messages to save files to disk.

@jasonsanjose We worked on this last night. I was going to explain the status at the 10am standup.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 17:42 GMT


Changed this to High Priority and Sprint 34 Milestone.

@core-ai-bot
Copy link
Member Author

Comment by fungl164
Thursday Nov 14, 2013 at 17:44 GMT


@redmunds we may have a shot at fixing it if we look at implementing applicationShouldTerminate app delegate listener method and then handle the saves there.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 17:51 GMT


@fungl164 Need the brackets UI to prompt user to Save, Discard, or Cancel, so I don't think that will work.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Thursday Nov 14, 2013 at 17:58 GMT


Plan B is in place, reverting the 3 pull requests related to the chrome profile changes: adobe/brackets-shell#381. Testing the build now.

@core-ai-bot
Copy link
Member Author

Comment by fungl164
Thursday Nov 14, 2013 at 18:00 GMT


@redmunds if anything, it could at least delay actual app close until all outstanding file saves are done by returning an NSTerminateLater; but ok if its not worth it.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 18:44 GMT


@fungl164 Sorry, but we ran out of time for Sprint 34 and have to backout this feature. Thanks again for your effort.

For Sprint 35, hopefully we get Dev Tools working in a Brackets window so we don't have to worry about this. Otherwise, we'll need to fix this bug.

@core-ai-bot
Copy link
Member Author

Comment by fungl164
Thursday Nov 14, 2013 at 20:47 GMT


Might be too late for the party, but check out https://github.com/fungl164/brackets-shell/compare/fungl164;chrome-live-osx-2 for a possible fix.

Can safely ignore https://github.com/fungl164/brackets-shell/tree/devtools-close

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Thursday Nov 14, 2013 at 21:47 GMT


Closing.

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

1 participant