Skip to content

terminal: fall back when a cwd_provider result names no folder (E475 today) #599

Open

Description

@ThomasK33

The terminal fails with E475 when a cwd_provider result names no folder, instead of falling back like cwd.resolve does.

Defect. When a cwd_provider returns text that names no existing folder after vim.fn.expand, terminal.lua build_config passes it on, and the terminal fails with E475 ("expected valid directory"). cwd.resolve drops such a value and tries the static cwd, then the git root. Main behaves this way; #569 did not change it.

Reproduction. Set terminal = { cwd_provider = function() return "/no/such/folder" end } and open the terminal.

Planned fix. Make build_config fall through to the static cwd and then the git root, as cwd.resolve does. This changes behavior, so update the README rule and add cases to tests/integration/terminal_cwd_spec.lua.

Owner: the next change to terminal.lua's cwd handling. Deferred from the README verification run with the maintainer's agreement.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageAwaiting maintainer triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions