nvim icon indicating copy to clipboard operation
nvim copied to clipboard

Working directory is changing unintentionally

Open ghost opened this issue 2 years ago • 2 comments

I notice that my working directory for a buffer frequently seems to have changed to a subdirectory rather than the project root. This provides unexpected results (no results usually) in grep search or file search. Do you know what may be causing the working directory to change? Thanks.

ghost avatar May 26 '22 17:05 ghost

Hi @grognaak Yes actually I have had this as an issue before, shortly after adding rmagatti/auto-session I was having 'collisions' though with a fish plugin z Do you use anything like that to jump to directories jump maybe? Could that be the case for you? I would suggest deleting your sessions and seeing if that solves the issue. For me sessions are stored in ~/.local/share/nvim/sessions, trash those and see if the issue continues for you.

bushblade avatar May 26 '22 21:05 bushblade

I haven't tried deleting my session yet, but I just triggered this bug (feature?) again by closing all my buffers, searching for a file with Telescope (CTRL-P), and hitting carriage return to open the file. Is this something we can disable in Telescope? If I have time, I will look. In my opinion, it's not desirable for this to happen.

Update: Seems like a simple grep search with leader-fs may trigger this, even without making a selection. And, deleting the session seems to fix the problem. Hope it lasts.

ghost avatar May 27 '22 02:05 ghost