Work around neovim bug where environ() crashes

This commit is contained in:
Ben Jackson 2020-02-16 19:43:54 +00:00
commit 0aba8e0179
2 changed files with 5 additions and 4 deletions

View file

@ -30,7 +30,9 @@ function! s:_OnEvent( chan_id, data, event ) abort
elseif a:event ==# 'exit'
echom 'Channel exit with status ' . a:data
redraw
unlet s:job
if exists( 's:job' )
unlet s:job
endif
" This causes terminal spam in neovim due to
" https://github.com/neovim/neovim/issues/11725
py3 _vimspector_session.OnServerExit( vim.eval( 'a:data' ) )

View file

@ -28,10 +28,9 @@ let s:buffer_to_id = {}
function! vimspector#internal#neoterm#PrepareEnvironment( env ) abort
let old_env = {}
let new_env = copy( environ() )
for key in keys( a:env )
if has_key( new_env, key )
let old_env[ key ] = new_env[ key ]
if exists( '$' . key )
let old_env[ key ] = getenv( key )
endif
call setenv( key, a:env[ key ] )
endfor