title: Issue of random indent error in VScode integrated terminal
body: <p>When trying to <em>run selected lines of code in Integrated Terminal</em>, I randomly get "IndentationError: unexpected indent". The same code executes perfectly in the OSX terminal, but fails 75% of the time in the integrated terminal. The error is happening to different lines, and happens mostly within functions.</p>
  
  <p>However, when I try to run functions batch by batch, it seems to work. I've tried pep8, flake8, pylint, manually indenting with 4 spaces, the autoindent. It seems that the error is coming from VSCode since I can reproduce when disabling Microsft Python and Don Jayamanne Python Extension.</p>
  
  <p>There have been many updates since I started using VSCode but here is the current set-up:</p>
  
  <pre><code>macOS High Sierra 10.13.4
  VSCode Version 1.22.1 (1.22.1)
  [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
  </code></pre>
  
  <p>My workspace settings are as follow:</p>
  
  <pre><code>{// PythonVSCode extensions
  "python.formatting.provider": "autopep8",
  "python.linting.pep8Enabled": true,
  "python.linting.enabled": true,
  "python.autoComplete.addBrackets": true,
  // Terminal
  "terminal.integrated.cursorStyle": "underline",
  "terminal.integrated.cursorBlinking": true,
  // Editor
  "workbench.colorTheme": "Visual Studio Dark",
  "editor.formatOnSave": true,
  "editor.formatOnType": true,
  "editor.wordWrap": "bounded",
  "editor.wordWrapColumn": 1000,
  "editor.quickSuggestionsDelay": 0,
  "editor.renderIndentGuides": true,
  "editor.insertSpaces": false,
  "editor.autoIndent": false,
  "editor.tokenColorCustomizations": {
      "comments": "#727a81",
  },
  "[markdown]": {
      "editor.quickSuggestions": true,
      "editor.wordWrap": "on"
  },
  }
  </code></pre>