Skip to content

[audit] Neovim 0.12.5 changed :restart's default behavior to save/restore session — interacts with server.lua's hop workflow #330

Description

@stanfish06

What

Neovim 0.12.5 (tagged 2026-08-23, one day before this audit cycle) backported a breaking change to the built-in :restart command: :restart with no bang now saves and restores the session (buffers + window layout) by default; the old "just restart, don't preserve anything" behavior moved to :restart!. ZR was also newly mapped as a shortcut for restart.

Both are marked as breaking (!) commits, even though delivered inside a patch release rather than a minor version bump.

Where

lua/config/server.lua:196-198 — the comment on ui_is_cross_machine() explicitly documents this config's own understanding of Neovim's built-in :connect/:restart server/client commands as part of its custom remote-hop tooling (":connect/:restart only work when the UI and server share a machine, so re-hopping is blocked from remote sessions").

Why it matters

server.lua builds a whole custom nvim-server-hopping feature (:NvimHop, :NvimRemote, :ShowNvimServers) on top of Neovim's native client/server primitives, and its own comments show the author already tracks :restart's semantics closely enough to gate re-hopping behavior around it. The config doesn't currently call :restart programmatically (grep confirms no vim.cmd.restart or scripted :restart invocation), so nothing breaks automatically — but a user typing :restart or the new ZR on a 0.12.5+ host now gets session-restore-by-default instead of a clean restart, which could resurrect buffers/window layout in the middle of a remote-hop session in a way this module wasn't written to anticipate.

Recommended action

  • No code changes are strictly required today.
  • If :restart/ZR is used manually as part of the hop workflow, be aware the plain form now restores session state; use :restart! for the previously-expected "clean" behavior.
  • Worth a short note near the ui_is_cross_machine() comment (or :ShowNvimServers help text) flagging the new default, since this module already documents :restart interactions for readers.
  • Not related to nvim-treesitter or completion breaking changes already tracked in [audit] Neovim 0.12 breaking changes — plugin compatibility checklist #283 — this is a distinct 0.12.5 patch-release change, not part of the 0.12.0 changelog that issue covers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions