-
-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Did you check docs and existing issues?
- I have read all the plugin docs
- I have searched the existing issues
- I have searched the existing opencode issues
Operating system/version
Macos
:checkhealth opencode output
opencode.nvim ~ - ✅ OK nvim version: 0.11.5. - ✅ OK opencode.nvim git commit hash: dfca5bb214d78a600781d50da350238b3e6e2621. - ✅ OK vim.g.opencode_opts: {} opencode.nvim [binaries] ~ - ✅ OK opencode available with version 1.0.202. - ✅ OK curl available. - ✅ OK pgrep available: it will be used to auto-find opencode if vim.g.opencode_opts.port is not set. - ✅ OK lsof available: it will be used to auto-find opencode if vim.g.opencode_opts.port is not set. opencode.nvim [snacks] ~ - ✅ OK snacks.input is enabled: ask() will be enhanced. - ✅ OK blink.cmp is available: opts.ask.blink_cmp_sources will be registered in ask(). - ✅ OK snacks.picker is enabled: select() will be enhanced. opencode.nvim [providers] ~ - ✅ OK Configured opencode provider: snacks. - ✅ OK The snacks provider is available. - kitty provider is not available — KITTY_LISTEN_ON environment variable is not set. - ADVICE: - Enable remote control in kitty. - wezterm provider is not available — wezterm executable not found in $PATH. - ADVICE: - Install wezterm and ensure it's in your $PATH. - tmux provider is not available — Not running inside a tmux session. - ADVICE: - Launch Neovim inside a tmux session. - ✅ OK The terminal provider is available.
Describe the bug
When opencode is launched, it uses the working directory from the moment Neovim starts (where the nvim command was executed), rather than tracking Neovim's actual current working directory. This causes a mismatch when:
- Using
nvim <folder>to open a different directory - Navigating to a project via a dashboard plugin (like alpha-nvim, dashboard-nvim, etc.)
- Changing directories within Neovim using
:cd,:tcd, or:lcd
Steps To Reproduce
Steps to Reproduce
Scenario 1: Using dashboard
- Run
nvimfrom~/(home directory) - Use a dashboard plugin to open a project at
~/projects/my-app - Trigger opencode (e.g.,
:lua require("opencode").toggle()) - Expected: opencode opens in
~/projects/my-app - Actual: opencode opens in
~/
Scenario 2: Using nvim <folder>
- From
~/, runnvim ~/projects/my-app - Trigger opencode
- Expected: opencode opens in
~/projects/my-app - Actual: opencode may open in
~/(depends on timing)
Scenario 3: Changing directory after opencode starts
- Start Neovim in
~/project-a - Trigger opencode (it correctly opens in
~/project-a) - Use
:cd ~/project-bto change Neovim's working directory - Try to interact with opencode
- Expected: opencode should work in
~/project-bor at least detect the mismatch - Actual: opencode continues working in
~/project-a
Expected Behavior
expected as 'Reproduce' expected