Python checkers: workaround for GNU readline brain damage.

On terms that support smm / rmm (f.i. xterm), initializing readline
prints the smm sequence, regardless of whether stdout is a terminal or
not, which in turn can make checkers' output unparseable.

Workaround: set TERM to dumb before calling the checkers.
This commit is contained in:
LCD 47 2014-04-23 21:16:41 +03:00
parent 3c07df5dfc
commit 4b00bf5b2e
10 changed files with 21 additions and 9 deletions

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:syntastic_start
endif
let g:syntastic_version = '3.4.0-44'
let g:syntastic_version = '3.4.0-45'
lockvar g:syntastic_version
" Sanity checks {{{1

View File

@ -19,7 +19,8 @@ function! SyntaxCheckers_python_flake8_GetHighlightRegex(item)
endfunction
function! SyntaxCheckers_python_flake8_GetLocList() dict
let makeprg = self.makeprgBuild({})
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb') })
let errorformat =
\ '%E%f:%l: could not compile,%-Z%p^,' .

View File

@ -19,7 +19,9 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_python_frosted_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '-vb' })
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb'),
\ 'args_after': '-vb' })
let errorformat =
\ '%f:%l:%c:%m,' .

View File

@ -14,7 +14,8 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_python_pep257_GetLocList() dict
let makeprg = self.makeprgBuild({})
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb') })
let errorformat =
\ '%E%f:%l:%c%\%.%\%.%\d%\+:%\d%\+: %m,' .

View File

@ -21,7 +21,8 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_python_pep8_GetLocList() dict
let makeprg = self.makeprgBuild({})
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb') })
let errorformat = '%f:%l:%c: %m'

View File

@ -14,7 +14,8 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_python_py3kwarn_GetLocList() dict
let makeprg = self.makeprgBuild({})
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb') })
let errorformat = '%W%f:%l:%c: %m'

View File

@ -40,7 +40,8 @@ function! SyntaxCheckers_python_pyflakes_GetHighlightRegex(i)
endfunction
function! SyntaxCheckers_python_pyflakes_GetLocList() dict
let makeprg = self.makeprgBuild({})
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb') })
let errorformat =
\ '%E%f:%l: could not compile,'.

View File

@ -23,7 +23,9 @@ function! SyntaxCheckers_python_pylama_GetHighlightRegex(item)
endfunction
function! SyntaxCheckers_python_pylama_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '-f pep8' })
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb'),
\ 'args_after': '-f pep8' })
" TODO: "WARNING:pylama:..." messages are probably a logging bug
let errorformat =

View File

@ -23,6 +23,7 @@ endfunction
function! SyntaxCheckers_python_pylint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb'),
\ 'args_after': (s:pylint_new ? '-f text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" -r n' : '-f parseable -r n -i y') })
let errorformat =

View File

@ -26,7 +26,9 @@ function! SyntaxCheckers_python_python_IsAvailable() dict
endfunction
function! SyntaxCheckers_python_python_GetLocList() dict
let makeprg = self.makeprgBuild({ 'exe': [self.getExec(), s:compiler] })
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb'),
\ 'exe': [self.getExec(), s:compiler] })
let errorformat = '%E%f:%l:%c: %m'