Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Allow existing windows to be used when running atom --wait - #16497

Merged
maxbrunsfeld merged 4 commits into
masterfrom
mb-reuse-windows-with-wait-flag
Jan 6, 2018
Merged

maxbrunsfeld merged 4 commits into
masterfrom
mb-reuse-windows-with-wait-flag

Conversation

@maxbrunsfeld

@maxbrunsfeld maxbrunsfeld commented Jan 5, 2018 •

Copy link
Copy Markdown
Contributor

Motivation

The --wait flag allows Atom to block until you are finished editing a file. Unfortunately, the way it is currently implemented, it simply opens a new Atom window and blocks until that entire window is closed. This means that opening a file with atom --wait is currently much slower than with atom, because the latter command can reuse an existing Atom window.

Solution

This PR changes the behavior of atom --wait so that it doesn't necessarily open a new window. It now uses the same criteria for selecting a window that the atom command normally uses, and can be freely combined with any other flag. Examples:

  • --wait --new-window - reproduce the old behavior of --wait
  • --wait file1 file2 add multiple files to the current window and block until they are all closed
  • --wait --add some-folder - add a project folder to the current window and block until this project folder is removed
  • --wait some-file some-folder

No matter how it is combined with other flags and arguments, atom --wait will block until all of the specified paths have been closed.

Result

Once this change ships, you might consider putting this line to your ~/.bash_profile:

export GIT_EDITOR='atom --wait'

rebase

Fixes #1433
Depends on #16500

@maxbrunsfeld
maxbrunsfeld force-pushed the mb-reuse-windows-with-wait-flag branch 2 times, most recently from 19f1ddc to ecfe8aa Compare January 6, 2018 00:54
@maxbrunsfeld
maxbrunsfeld force-pushed the mb-reuse-windows-with-wait-flag branch from e97289e to 6f50f32 Compare January 6, 2018 01:50
@maxbrunsfeld
maxbrunsfeld merged commit ec06fb2 into master Jan 6, 2018
@maxbrunsfeld
maxbrunsfeld deleted the mb-reuse-windows-with-wait-flag branch January 6, 2018 03:59
jasonrudolph added a commit to jasonrudolph/dotfiles that referenced this pull request Jan 8, 2018
Now that `atom --wait` is fast, I can use it for authoring Git commits!
😅

/xref 31c5797
/xref atom/atom#16497
/xref atom/atom#1433
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When you use atom as your git editor it is quite slow to open the git commit text (compared to other

1 participant