Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown function: environ #208

Open
endoped opened this issue Mar 2, 2022 · 1 comment
Open

Unknown function: environ #208

endoped opened this issue Mar 2, 2022 · 1 comment

Comments

@endoped
Copy link

endoped commented Mar 2, 2022

I'm getting this error on vim v8.1, tmux v2.8 after pulling in the change from #204

Error detected while processing function VimuxPromptCommand[10]..VimuxRunCommand[2]..VimuxOpenRunner[1]..<SNR>23_nearestIndex[3]..VimuxTmux:
line    5:
E117: Unknown function: environ
E116: Invalid arguments for function has_key(environ(), 'TMUX')

I did this to fix it. Not sure if this is something you want to look into or if it's just an issue with my environment that I don't care to take the time to fix.

index 0737d74..7e3d04d 100644
--- a/plugin/vimux.vim
+++ b/plugin/vimux.vim
@@ -189,7 +189,7 @@ function! VimuxTmux(arguments) abort
   if VimuxOption('VimuxDebug')
     echom VimuxOption('VimuxTmuxCommand').' '.a:arguments
   endif
-  if has_key(environ(), 'TMUX')
+  if exists('$TMUX')
     return system(VimuxOption('VimuxTmuxCommand').' '.a:arguments)
   else
     throw 'Aborting, because not inside tmux session.'
@endoped endoped changed the title environ() Unknown function: environ Mar 2, 2022
@alerque
Copy link
Member

alerque commented Mar 3, 2022

The environ() function was added in VIM 8.1.1305 back in 2019. It also exists in NeoVIM. I'm not too keen on supporting old versions, but your alternative for this simple task probably wouldn't hurt in this case as long as current VIM & NeoVIM versions support it the same way. I'd be happy to review a PR if you submit this change.

Also note your tmux is obscenely outdated. I'm not 100% sure 2.x releases are even supported by this plugin. If you run into more trouble consider updating to something from the last few years.

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

No branches or pull requests

2 participants