daa84 / neovim-gtk

gtk ui for neovim
GNU General Public License v3.0
717 stars 56 forks source link

Multiple instances share working directory #19

Closed omega closed 6 years ago

omega commented 6 years ago

I am not really sure if this problem is in neovim-gtk or somewhere else (it does not happen in neovim alone)

if I launch neovim-gtk from two different folders (one after the other), the neovim-gtk launched last will have the working directory of the first instance, so things like Ctrl-P will lookup files from the wrong folder.

Steps to reproduce:

  1. launch neovim-gtk in ~/tmp/a
  2. launch neovim-gtk in ~/tmp/b
  3. launch CtrlP in second instance, and see the files from ~/tmp/a show up when you search
daa84 commented 6 years ago

neovim-gtk uses GtkApplication - that prevent run multiple instances of same application. So when you open new neovim-gtk window - it just send signal to same application to open new window.

omega commented 6 years ago

aha.. could it be worked around somehow, where upon opening a new window, we tell neovim that cwd is not the same as the parent app, or can we tell it to change it?

daa84 commented 6 years ago

Can't say, need to check what come into open signal. One way is to just disable single instance. Single instance allow to open file in same application window instead of new one, maybe in new tab. Can't say what the best solution here.