Answer: Use the `-w` or `--wait` flag, which waits for all opened files to be closed before the CLI exits. For git integration, set `export EDITOR="zed --wait"`. Status: Overdue (check was due 2026-11-20T13:44:24Z and has not succeeded) Entry: tool/zed/commands-and-shortcuts/wait-option Revision: 1 Digest: sha256:a35952810ba72526 (changes whenever the content changes) Timeline: Created: 2026-11-13T04:05:53Z Last changed: 2026-11-13T04:05:53Z Last verified: 2026-11-19T13:44:24Z Next check: 2026-11-20T13:44:24Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of flag | --wait | [1] | 2026-11-19 behavior | Wait for all opened files to be closed before the CLI exits. | [1] | 2026-11-19 git editor setting | export EDITOR="zed --wait" | [1] | 2026-11-19 Sources: [1] Zed Industries. "zed.dev/docs/reference/cli.md". https://zed.dev/docs/reference/cli.md Role: primary. Accessed: 2026-11-19T13:44:24Z Quote: "### `-w`, `--wait`" (Supports: flag) Quote: "Wait for all opened files to be closed before the CLI exits." (Supports: behavior) Quote: "export EDITOR="zed --wait"" (Supports: git editor setting) Snapshot SHA-256: 50dc19853554c9b8817250fbc9e7c8ef5fe2881a30294dece98d1695a494c9dd (captured 2026-11-19T13:44:23Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-19T13:44:24Z. No independent second source is configured for this entry Last successful check: 2026-11-19T13:44:24Z Last attempt: 2026-11-19T13:44:24Z Notes and limitations: Extracted automatically from a single official source (section "`-w`, `--wait`"). Human-readable page: https://zed.dev/docs/reference/cli.html Related: https://latestn.com/tool/zed/commands-and-shortcuts/wrap-with-abbreviation How do I wrap selected text with an Emmet abbreviation in Zed? https://latestn.com/tool/zed/features/add-contact How do I add a contact in Zed for private calls? https://latestn.com/tool/zed/features/add-folder-to-project How do I add another folder to an existing project in Zed? https://latestn.com/tool/zed/commands-and-shortcuts/tab-switcher-actions What commands and keybindings are available for the Zed Tab Switcher? https://latestn.com/tool/zed/commands-and-shortcuts/task-keybindings How do I bind a custom keybinding to run a Zed task? https://latestn.com/tool/zed/commands-and-shortcuts/toggle-project-panel How do I toggle the Project Panel in Zed? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T04:05:53Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/zed/commands-and-shortcuts/wait-option/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/zed/commands-and-shortcuts/wait-option POST: https://latestn.com/dispute/tool/zed/commands-and-shortcuts/wait-option with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/zed/commands-and-shortcuts/wait-option?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I make Zed wait for files to close before exiting, for use as git editor? Revision 1, last verified 2026-11-19T13:44:24Z. https://latestn.com/tool/zed/commands-and-shortcuts/wait-option (accessed 2026-11-21T10:04:04Z). @misc{LatestN_tool_zed_commands_and_shortcuts_wait_option_r1, title = {How do I make Zed wait for files to close before exiting, for use as git editor?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/zed/commands-and-shortcuts/wait-option}}, note = {Revision 1; digest sha256:a35952810ba72526; last verified 2026-11-19T13:44:24Z; accessed 2026-11-21T10:04:04Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/zed/commands-and-shortcuts/wait-option