Skip to content

fix: Remove cd side effect when executing pio commands - #73

Open
kyufie wants to merge 1 commit into
anurag3301:mainfrom
kyufie:cd-fix
Open

fix: Remove cd side effect when executing pio commands#73
kyufie wants to merge 1 commit into
anurag3301:mainfrom
kyufie:cd-fix

Conversation

@kyufie

@kyufie kyufie commented Jul 26, 2026

Copy link
Copy Markdown

Right now, whenever the plugin wants to execute pio commands, cd is performed to move nvim to the project's root. This is not a good approach because it moves the current directory without the user's consent, which affects subsequent terminal spawns and most importantly, things like telescope search.

This change ensures pio commands executed do not affect the global current working directory. I've also improved the project root lookup function to not rely on hardcoded constants.

@anurag3301

Copy link
Copy Markdown
Owner

Yeah, I think thats not cool either. I'll review and try your changes and merge it soon

@kyufie

kyufie commented Jul 27, 2026

Copy link
Copy Markdown
Author

Thanks.

On a related note, I'm also thinking about using vim.fs.root to perform the project root lookup and vim.system exclusively for the command spawn function. Right now, both helpers still utilize the old API, and those two functions are the modern replacement for them. I wish to change it, but they do require nvim 0.10 which came out two years ago. Let me know if you want to change it.

@dhupee

dhupee commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@anurag3301 don't put directly to main mate, careful

@anurag3301

Copy link
Copy Markdown
Owner

@dhupee yeah I wont, I am yet to test them out. But the recommendation makes sense, what do you think?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants