Index: test/DebuggerCommandsTest.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- test/DebuggerCommandsTest.js	(revision 13:cf2a62349a31dcd4066c9d698738880a52c596bf)
+++ test/DebuggerCommandsTest.js	(revision 13+:cf2a62349a31+)
@@ -9,7 +9,8 @@
 
 var StringBuffer = require("./StringBuffer");
 
-var DebuggerCommands = require("../src/DebuggerCommands");
+var DebuggerCommands = require("../src/DebuggerCommands"),
+    DebuggerParser = require("../src/DebuggerParser");
 
 describe("DebuggerCommands Tests", function() {
   var client,
@@ -186,5 +187,31 @@
     commands.on("terminated", done);
 
     commands._parser.push({ name: "terminated" });
+  });
+
+  should("issue variables command", function(done) {
+    commands.variables();
+
+    checkBuffer("y\n", done);
+  });
+
+  should("set debugger parser into variable parse mode given variables command issued", function() {
+    commands.variables();
+
+    expect(commands._parser.getMode()).to.equal(DebuggerParser.VARIABLE_PARSE_MODE);
+  });
+
+  should("set debugger parser to scan mode given variables command finished", function(done) {
+    commands.variables();
+
+    process.nextTick(function() {
+      emitPrompt();
+
+      process.nextTick(function() {
+        expect(commands._parser.getMode()).to.equal(DebuggerParser.SCAN_MODE);
+
+        done();
+      });
+    });
   });
 });
\ No newline at end of file
Index: src/DebuggerParser.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/DebuggerParser.js	(revision 13:cf2a62349a31dcd4066c9d698738880a52c596bf)
+++ src/DebuggerParser.js	(revision 13+:cf2a62349a31+)
@@ -13,7 +13,7 @@
 module.exports = DebuggerParser;
 
 DebuggerParser.SCAN_MODE = "scan";
-DebuggerParser.PARSE_MODE = "parse";
+DebuggerParser.VARIABLE_PARSE_MODE = "variable-parse";
 
 /**
  * @typedef {Object} DebuggerParserConfiguration
@@ -31,38 +31,41 @@
   TransformStream.call(this, { objectMode: true });
 
   this._mode = DebuggerParser.SCAN_MODE;
-  /** @type {DebuggerVariableParser} */
+  /** @type {DebuggerStackTaceParser} */
   this._variableParser = new DebuggerVariableParser(config);
   this._variableParser.on("readable", this._eventProxy(this._variableParser));
 
   this._logger = Logger.initLogger(config);
 }
 
-//noinspection JSUnusedGlobalSymbols
-DebuggerParser.prototype._transform = function(chunk, encoding, done) {
-  if (/^[$@%]/.test(chunk) || this._mode === DebuggerParser.PARSE_MODE) {
-    // we're parsing variables
-    if (this._mode !== DebuggerParser.PARSE_MODE) {
-      this._logger("Beginning parse");
-    }
+DebuggerParser.prototype.getMode = function() {
+  return this._mode;
+};
 
-    this._mode = DebuggerParser.PARSE_MODE;
-    this._variableParser.write(chunk, encoding);
+DebuggerParser.prototype.setMode = function(mode) {
+  this._mode = mode;
+};
 
-    done();
+DebuggerParser.prototype.reset = function() {
+  this._mode = DebuggerParser.SCAN_MODE;
+};
 
-    return;
+//noinspection JSUnusedGlobalSymbols
+DebuggerParser.prototype._transform = function(chunk, encoding, done) {
+  if (this._mode === DebuggerParser.VARIABLE_PARSE_MODE) {
+    this._variableParser.write(chunk, encoding);
   }
 
+  if (this._mode === DebuggerParser.SCAN_MODE) {
-  chunk.split("\n").forEach(this._scan.bind(this));
+    chunk.split("\n").forEach(this._scan.bind(this));
+  }
+
   done();
 };
 
 //noinspection JSUnusedGlobalSymbols
 DebuggerParser.prototype._flush = function(done) {
-  if (this._mode === DebuggerParser.PARSE_MODE) {
-    this._variableParser.end();
+  this._variableParser.end();
-  }
 
   done();
 };
\ No newline at end of file
Index: src/DebuggerCommands.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/DebuggerCommands.js	(revision 13:cf2a62349a31dcd4066c9d698738880a52c596bf)
+++ src/DebuggerCommands.js	(revision 13+:cf2a62349a31+)
@@ -84,6 +84,11 @@
   var deferred = Q.defer();
   this._emitter.once("variables", deferred.resolve);
   this._emitter.once("parsingerror", deferred.reject);
+  this._emitter.once("prompt", function() {
+    this._parser.setMode(DebuggerParser.SCAN_MODE);
+  }.bind(this));
+
+  this._parser.setMode(DebuggerParser.VARIABLE_PARSE_MODE);
 
   //noinspection JSValidateTypes
   return deferred.promise;
\ No newline at end of file
