diff --git a/lib/index.js b/lib/index.js index 69ff4659..aa7bb148 100644 --- a/lib/index.js +++ b/lib/index.js @@ -27,6 +27,12 @@ function getContext() { // If process is an object, we're probably running in Node or Electron // From: http://stackoverflow.com/a/24279593/1417293 if (typeof process === 'object' && process + '' === '[object process]') { + + // Visual Studio Code defines the global.__debug__ object. + if (typeof global !== 'undefined' && global.__debug__) { + return 'vscodedebugger'; + } + return process.type === 'renderer' ? 'electron' : 'nodejs'; }