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

fix: restore shell options when aborts #475

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions autoload/codeium/server.vim
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,17 @@ function! s:UnzipAndStart(status) abort
set shellquote= shellpipe=\| shellxquote=
set shellcmdflag=-NoLogo\ -NoProfile\ -ExecutionPolicy\ RemoteSigned\ -Command
set shellredir=\|\ Out-File\ -Encoding\ UTF8
call system('& { . ' . shellescape(s:root . '/powershell/gzip.ps1') . '; Expand-File ' . shellescape(s:bin . '.gz') . ' }')
" Restore old settings.
let &shell = old_shell
let &shellquote = old_shellquote
let &shellpipe = old_shellpipe
let &shellxquote = old_shellxquote
let &shellcmdflag = old_shellcmdflag
let &shellredir = old_shellredir
try
call system('& { . ' . shellescape(s:root . '/powershell/gzip.ps1') . '; Expand-File ' . shellescape(s:bin . '.gz') . ' }')
finally
" Restore old settings.
let &shell = old_shell
let &shellquote = old_shellquote
let &shellpipe = old_shellpipe
let &shellxquote = old_shellxquote
let &shellcmdflag = old_shellcmdflag
let &shellredir = old_shellredir
endtry
else
if !executable('gzip')
call codeium#log#Error('Failed to extract language server binary: missing `gzip`.')
Expand Down