From d55402724a82d877ffe9f8f026c9bd41a211d58a Mon Sep 17 00:00:00 2001 From: daniprado Date: Thu, 19 May 2022 17:46:52 +0200 Subject: [PATCH] Fix $NVR_CMD (#179) Fixes https://github.com/mhinz/neovim-remote/issues/178 --- nvr/nvr.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nvr/nvr.py b/nvr/nvr.py index 30af8f6..705b1d6 100644 --- a/nvr/nvr.py +++ b/nvr/nvr.py @@ -73,14 +73,16 @@ class Nvr(): Use --nostart to avoid starting a new process. ''')) - arg0 = os.environ.get('NVR_CMD') or 'nvim' + args = os.environ.get('NVR_CMD') + args = args.split(' ') if args else ['nvim'] + args.extend(['--listen', self.address]) - multiprocessing.Process(target=self.try_attach, args=([arg0], nvr, options, arguments)).start() + multiprocessing.Process(target=self.try_attach, args=(args[0], nvr, options, arguments)).start() try: - os.execvpe(arg0, [arg0, '--listen', self.address], os.environ) + os.execvpe(args[0], args, os.environ) except FileNotFoundError: - print(f'[!] Can\'t start new nvim process: `{arg0}` is not in $PATH.') + print(f'[!] Can\'t start new nvim process: `{args[0]}` is not in $PATH.') sys.exit(1) def read_stdin_into_buffer(self, cmd):