neovim/node-host

`process.chdir` is undefined

alexlafroscia opened this issue · 5 comments

So, I currently maintain the vim-ember-cli plugin and am looking into using node-host to make the code a lot easier to maintain. One of the dependencies is trying to access process.chdir and it seems to be undefined for some reason. Any idea as to why that might be?

Good question. I was wondering if/when this question would come up. Here's the relevant line of code.

Right now, chdir is disabled since it's a "dangerous" operation--that is, one that changes the context for all plugins running under the host. One alternative is to spawn a separate process, but that would add some overhead for IPC. While I'd be happy to implement this, my first question is whether there any way that you run your tool without changing the process directory.

Yeah, I looked at the dependency code and did find a way around it, so it seems that it won't be an issue anymore. It's good to know about that change, though; maybe add some information in this repo's wiki? I would be happy to assist with that if possible.

add some information in this repo's wiki

Excellent idea! It has been done.

Please feel free to post any other suggestions/fixes you have as you work on your plugin!

Thanks! I'm pretty excited to be able to work with JavaScript instead of VimScript. There's still some things I need to figure out (like, I currently use vim-dispatch to run async tasks, and need to figure out a new UI for showing their progress and results), but I think this has a lot of promise. If you have any suggestions on ways to handle async tasks that might need user interaction, I'd love to hear them.

If you have any suggestions on ways to handle async tasks that might need user interaction,

If dispatch was working well for you (except for the platform inconsistencies), best thing would be to add a neovim provider to dispatch upstream. tpope/vim-dispatch#124