Change:
constructor(private configurationService: IConfigurationService) { } getHeight(element: IReplElement): number { <ins> const countNumberOfLines = (str: string) => Math.max(1, (str.match(/rn|n/g) || []).length); </ins> // Give approximate heights. Repl has dynamic height so the tree will measure the actual height on its own. const fontSize = this.configurationService.getValue<IDebugConfiguration>('debug').console.fontSize; const rowHeight = Math.ceil(1.4 * fontSize); <del> if (element instanceof Expression && element.hasChildren) { return 2 * rowHeight; } </del> // In order to keep scroll position we need to give a good approximation to the tree <del> if (element instanceof SimpleReplElement) { // For every 150 characters increase the number of lines needed let count = Math.ceil(element.value.length / 150); for (let i = 0; i < element.value.length; i++) { if (element.value[i] === 'n' || element.value[i] === 'rn') { count++; } </del> <ins> // For every 150 characters increase the number of lines needed if (element instanceof Expression) { let { name, value } = element; let nameRows = countNumberOfLines(name) + Math.floor(name.length / 150); if (element.hasChildren) { return (nameRows + 1) * rowHeight; </ins> } <del> return Math.max(1, count) * rowHeight; </del> <ins> let valueRows = countNumberOfLines(value) + Math.floor(value.length / 150); return rowHeight * (nameRows + valueRows); } if (element instanceof SimpleReplElement) { let value = element.value; let valueRows = countNumberOfLines(value) + Math.floor(value.length / 150); return valueRows * rowHeight; </ins> } return rowHeight;

Discussion:
Issue Type: <bBug</bSee also - but note that people say they Debug console behaves normally Debug console scrolls to top after each evaluated line this code as breakpoints at "Uncaught exceptions" in VS Code hitting SystemExit exception, run in Debug console. a bunch of times (1-5 times) in the Debug console. that at one point, Debug console scrolls to top to bottom of Debug console output in Debug console. that you don't see due to Debug console scrolling near top again. VS Code version: Code 1.32.1 (, 2019-03-08T00:51:49.278Z) OS version: WindowsNT x64 10.0. <details<summarySystem Info</summary </details<details<summaryExtensions (5)</summaryExtensionVersion ------ latex-workshop6.2.0 svn-scm1.47.1 python2019.2.5558 multi-command1.3.0 code-settings-sync3.2.7 </details<!-- generated by issue reporter --
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like: <!-- score: 0.628 --- <!-- score: 0.584 --- <!-- score: 0.578 --- <!-- score: 0.544 --- <!-- score: 0.502 --<!-- potentialduplicatescomment --
Yes, looks like is a duplicate of this one, although does not have specific reproduction steps. This one does. Also, it looks like they investigated 1.32.0-insider, while I am still seeing this in 1.32.1. Also, I can repro this in the latest insider build with only the Python extension and no settings changed whatsoever (see below). Finally, I must admit finding repro steps was a bit difficult. So I am not fully convinced this issue is fixed, as implied by .
I can not reproduce this. Can you attach a gif / video showing this can you repro this using python?
Sure, here's a GIF: !
I can not reproduce with node. please try reproducing with python if you F1 developer tools put a breakpoint what do you see as scrollTop, scrollHeight and renderHeight at the exact moment when the debug console scrolls unexpectedly?
I encountered exactly the same issue as
then you can also try to answer the quesionts i asked .

Get your hands dirty and do some debugging. Thanks
Breakpoint is hit twice per manual . After the first time manually entering , with the breakpoint hit at line 85: scrollTop = 0, scrollHeight = 19, renderHeight = 214 scrollTop = 0, scrollHeight = 480, renderHeight = 214 After the second time manually entering : scrollTop = 266, scrollHeight = 480, renderHeight = 214 scrollTop = 266, scrollHeight = 80, renderHeight = 214 (+) After (+), debug console is scrolled to top. I noticed that during (+), the debug console is empty, but not during any of the other breakpoint hits. I double-checked: is not a typo of , the above numbers are correct.
Yes, I too can replicate this issue on my Mac
Ok, thanks for help everybody. I can repro on my mac. Investigating...
After investigating and discussion with we figured out it is a dup of
Version: 1.34.0-insider Commit: Date: 2019-04-19T19:59:19.092Z Electron: 3.1.8 Chrome: 66.0.3359.181 10.2.0 V8: 6.6.346.32 OS: Darwin x64 18.2.0 This issue is not fixed in latest Insider and bugs me every day: !
I'm facing this since few months now. Any clue on how to avoid this issue? Please do not keep on closing this issue as it is real.
Check the insider release and see if it's fixed for you (it was for me). It seems the maintainers have chosen to leave this broken for everyone until their next major release next month which is unfortunate.
I'm on Insiders, it's not fixed for me.. Version: 1.34.0-insider Commit: Date: 2019-04-19T19:59:19.092Z Electron: 3.1.8 Chrome: 66.0.3359.181 10.2.0 V8: 6.6.346.32 OS: Darwin x64 18.2.0
I have the same issue.

Version: 1.33.1 Commit: Date: 2019-04-11T08:20:22.771Z Electron: 3.1.6 Chrome: 66.0.3359.181 10.2.0 V8: 6.6.346.32 OS: Linux x64 4.15.0-34-generic snap
I'm having this issue even on the latest Insiders version (1.34.20-insider) See gif here :
Same issue here. Version: 1.33.1 (system setup) Commit: Date: 2019-04-11T08:27:09.080Z Electron: 3.1.6 Chrome: 66.0.3359.181 10.2.0 V8: 6.6.346.32 OS: Windows_NT ia32 10.0.
please do not close this issue. I am experiencing same problem: VSCode version: 1.33.1 System Software Overview: System Version: macOS 10.14.4 (18E226) Kernel Version: Darwin 18.5.0 Boot Volume: Mac OS Boot Mode: Normal Computer Name: iMac001 Secure Virtual Memory: Enabled System Integrity Protection: Enabled Time since boot: 7 days 6 minutes
sorry that this is a pain. I am looking into it but can not reproduce. Can you provide exact steps please?
Hi OP here. I can still repro the bug in official 1.34.0, so this is certainly not fixed. However, my repro steps from the original description do not work any longer as running actually ends the process that is debugged. I managed to repro the same issue with . So these are my current repro steps: this code as in VS Code hitting the breakpoint, run in Debug console. a bunch of times (1-5 times) in the Debug console. that at one point, Debug console scrolls up quite a bit to bottom of Debug console output in Debug console. that you don't see due to Debug console scrolling near top again. Here's a gif as well. (The gif misses step 6, but I think it gets the main issue across.) !
Thanks for the steps, I will look into this this or next week.

we have pushed a fix with the help of Please try it with VSCode insiders starting from Tuesday which will have the fix. Thank you
I have just checked and it seems to me the issue is gone, thank you! (Of course, I will be more confident once an actual release has the fix as I haven't re-setup insiders the exact same way I use my release version - let's hope for the best!)
Thanks. Adding verified label. Let us know how it goes once you get the stable update.
Stable looks good to me, too, thanks!