-
Notifications
You must be signed in to change notification settings - Fork 82
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
Strip escape sequences in diff output #131
Comments
Hi @zharmany, I think that’s a tricky problem. Do you get it only with better whitespace or with all The
Otherwise you can maybe use it to insert something before the diff command that clears up any garbage thrown out by your login script? Not sure how to go about that though. Also note that the diff command is only used to strip whitespace on modified lines only. You can disable that option and better-whitespace will strip all lines of the file. |
Thanks for the reply. In my situation, it was with all With that said, I don't think changing the There's probably a few different ways to solve this, but I'm not versed enough in Vimscript to know what would be the appropriate way to go. Thanks for the suggestion about modified lines, but that's precisely one of the awesome features I like :). I work on a shared codebase with folks that are not as persnickety as me, so I'd be making all sorts of whitespace changes in the codebase. |
I think the only way to fix this is to make your You can probably make it silent only for non-interactive shells and let it print as usual for interactive sessions. |
Hi there,
I've been recently getting odd errors when stripping whitespace upon save. I eventually diagnosed this as being related to setting my Vim shell to be a bash login shell, via
let &shell='bash -l'
.What happens is that during the course of sourcing my dotfiles for my fancy prompt and such, the
tput sgr0
command is issued, which causes the printing of escape characters that reset any color / styling effect for text.This messes up the output of the diff command in vim-better-whitespace, the line being
For now, I'm just going to comment out the
tput sgr0
line in my.bash_profile
and hope for the best, but I'm wondering if there's a more robust way to get the diff output (avoiding the shell altogether, or strip the escape sequences). I do realize that this more of a me problem than a you problem.The text was updated successfully, but these errors were encountered: