Skip to content

Unknown function: environ #208

@endoped

Description

@endoped

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.'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions