Syntastic doesn't know, nor particularly cares, about the contents
of your files. What syntastic does is run third-party linters against
your files, parses the results, and shows them in a window. You
can see how syntastic runs linters by enabling debugging (see ":h
syntastic-debug"). You can change hos syntastic runs linters by setting
the various "*_args" options (cf. ":h syntastic-config-makeprg"). If
you still can't reproduce in a terminal what syntastic gets when it runs
the linters from Vim you probably need to look at the difference in
configuration between your shell and Vim's shell. Sadly, none of this
is as easy as it should be though. _shrug_
/lcd