title: GDB "layout src" terminal window output corruption
body: <p>I am using the "layout src" tui feature within gdb (amazing if you haven't used it) which allows you to step through the source code, showing the surrounding code in the terminal whilst you step through.</p>
  
  <p>However, occasionally/bordering on frequently I encounter an issue where the terminal output becomes corrupted. The output on the screen becomes mixed, with source code from previous and current stack frames showing. I have seen this on Red Hat 6.5 and CentOS 6. The GDB version is 7.11</p>
  
  <p>The latest instance of this occurring (5 mins ago) seems to have been triggered when I stepped over code which output to the screen.</p>
  
  <p>I have seen this problem in various different code bases, at different companies and its a shame because the gdb tui mode is very helpful.</p>
  
  <p>Does anyone know how to fix this/what causes it? </p>