xi-editor / xi-mac

The xi-editor mac frontend.
Apache License 2.0
3.02k stars 147 forks source link

460 xi --wait does not return after application exit #483

Closed mohanio closed 4 years ago

mohanio commented 4 years ago

Summary Issue: https://github.com/xi-editor/xi-mac/issues/460 xi --wait does not return after application exit

CLI xi --wait does not exit when the XiEditor app is killed using CMD+Q

XiEditor posts "io.xi-editor.XiEditor.FileClosed" notification on windowShouldClose(_ sender:) which is invoked whenever window is closed. But this delegate is not invoked when the app is killed using CMD+Q

Fix: NSDocument invokes close() on both app termination and window close so, instead of windowShouldClose(_ sender:) rely on NSDocument's close() method to post "io.xi-editor.XiEditor.FileClosed" notification

Now Xi CLI should stop waiting both on closing a window and on app exit(CMD+Q)

Related Issues

closes #460

Checklist

Example:

Review Checklist