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

Node debugger issues with colour #76

Open
Cybolic opened this issue Feb 3, 2019 · 3 comments
Open

Node debugger issues with colour #76

Cybolic opened this issue Feb 3, 2019 · 3 comments

Comments

@Cybolic
Copy link

Cybolic commented Feb 3, 2019

The integration with the node debugger seems to trip over the colour codes that node prints. These should probably be disabled using the NODE_DISABLE_COLORS=1 environment variable.
(EDIT: node doesn't seem to respect the variable on my system, so this might need to just be filtered out in the return strings instead)

To clarify, I'm seeing output like (after running VBGevalWordUnderCursor on the word email):

Vim's error output Vebugger:Shell

E115: Missing quote: 'email:                                                                                                                                                                                                                                                                                                                                                          
E116: Invalid arguments for function join

Vebugger:Terminal

^[[1G^[[0Jdebug> ^[[8Gexec (function(){var glbCacheForEval123abf = [];let ret = JSON.stringify(email, function(key,value){if(typeof value==='object'&&value!==null){if(glbCacheForEval123abf.indexOf(value)!==-1){try{return JSON.parse(JSON.stringify(value))}catch(error){return}}glbCacheForEval123abf.push(value)}return value}, 2);return ret;})()

^[[32m'"[email protected]"'^[[39m

This happens for pretty much any command I run. The command itself seems to work, so I'm assuming it's the parsing of the output that triggers the error.

@IngoMeyer441
Copy link
Collaborator

For a quick and simple fix you can use the AnsiEsc plugin which converts escape codes in vim buffers to colored text regions.

@Cybolic
Copy link
Author

Cybolic commented Feb 3, 2019

The AnsiEsc plugin certainly helps with the Terminal output, but not with the error messages in Shell. Is there at least a way to mute them? (sorry if this is obvious; I'm still relatively new to more advanced usage of Vim)
EDIT: I've tried :silent! VBGevalWordUnderCursor but the E115/E116 errors still get printed, requiring an extra press of enter to continue working.

@nilsboy
Copy link

nilsboy commented Nov 19, 2019

FYI - Autocommand to fix the colors (also disable line wrap) in the vebugger terminal window.

augroup MyVebuggerAugroupSetupTerminalWindow
  autocmd!
  autocmd FileType VebuggerTerminal :AnsiEsc
  autocmd FileType VebuggerTerminal :setlocal nowrap
augroup END

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants