Vscode: Debug console scrolls near top after each evaluated line after exception raised in debug console

Created on 12 Mar 2019  路  26Comments  路  Source: microsoft/vscode

Issue Type: Bug

See also https://github.com/Microsoft/vscode-python/issues/4725 - but note that vscode-python people say they

do not control the scrolling behavior of the debug console in VS Code

Expected behaviour

Debug console behaves normally

Actual behaviour

Debug console scrolls to top after each evaluated line

Steps to reproduce:

  1. Save this code as Bug.py:
import sys
sys.exit()
  1. Enable breakpoints at "Uncaught exceptions"
  2. Debug Bug.py in VS Code
  3. When hitting SystemExit exception, run print(1) in Debug console.
  4. Run sys.exit() a bunch of times (1-5 times) in the Debug console.
  5. Notice that at one point, Debug console scrolls to top
  6. Scroll to bottom of Debug console output
  7. Run print(2) in Debug console.
  8. Notice that you don't see 2 due to Debug console scrolling near top again.

VS Code version: Code 1.32.1 (05f146c7a8f7f78e80261aa3b2a2e642586f9eb3, 2019-03-08T00:51:49.278Z)
OS version: Windows_NT x64 10.0.17763


System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i5-4310M CPU @ 2.70GHz (4 x 2694)|
|GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_off
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: unavailable_off|
|Memory (System)|7.91GB (2.69GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|

Extensions (5)

Extension|Author (truncated)|Version
---|---|---
latex-workshop|Jam|6.2.0
svn-scm|joh|1.47.1
python|ms-|2019.2.5558
multi-command|ryu|1.3.0
code-settings-sync|Sha|3.2.7


bug debug verified

Most helpful comment

Ok, thanks for help everybody.
I can repro on my mac. Investigating...

All 26 comments

Yes, looks like #69207 is a duplicate of this one, although #69207 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 #69207.

Version: 1.33.0-insider
Commit: 49c10b916705b6006f04d0701875098b26d1d70b
Date: 2019-03-12T06:17:28.991Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17763

I can not reproduce this.
Can you attach a gif / video showing this
@DonJayamanne can you repro this using python?

Sure, here's a GIF:
2019-03-13_10-35-42

I can not reproduce with node.
@DonJayamanne please try reproducing with python
@bersbersbers if you F1 > developer tools > put a breakpoint here 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 @bersbersbers.

@razhangwei then you can also try to answer the quesionts i asked @bersbersbers . Get your hands dirty and do some debugging. Thanks

@bersbersbers if you F1 > developer tools > put a breakpoint here what do you see as scrollTop, scrollHeight and renderHeight at the exact moment when the debug console scrolls unexpectedly?

Breakpoint is hit twice per manual sys.exit().

After the first time manually entering sys.exit(), 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 sys.exit():

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: 80 is not a typo of 480, 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 @joaomoreno we figured out it is a dup of https://github.com/Microsoft/vscode/issues/68385

Version: 1.34.0-insider
Commit: 750680d2f7ae563529501f8ec419d83ccf8ec325
Date: 2019-04-19T19:59:19.092Z
Electron: 3.1.8
Chrome: 66.0.3359.181
Node.js: 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:

gif

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.

https://github.com/Microsoft/vscode/issues/71737

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.

@kepeterson I'm on Insiders, it's not fixed for me..

Version: 1.34.0-insider
Commit: 750680d
Date: 2019-04-19T19:59:19.092Z
Electron: 3.1.8
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Darwin x64 18.2.0

I have the same issue.
Version: 1.33.1
Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8
Date: 2019-04-11T08:20:22.771Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Linux x64 4.15.0-34-generic snap

@kepeterson I'm having this issue even on the latest Insiders version (1.34.20-insider)

See gif here :
https://github.com/microsoft/vscode/issues/71737#issuecomment-492986211

Same issue here.

Version: 1.33.1 (system setup)
Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8
Date: 2019-04-11T08:27:09.080Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT ia32 10.0.17134

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

@octref sorry that this is a pain. I am looking into it but can not reproduce.
Can you provide exact steps please?

Hi @isidorn, 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 sys.exit() actually ends the process that is debugged. I managed to repro the same issue with throw 1. So these are my current repro steps:

  1. Save this code as Bug.py:
breakpoint()
print(0)
  1. Debug Bug.py in VS Code
  2. When hitting the breakpoint, run print(1) in Debug console.
  3. Run throw 1 a bunch of times (1-5 times) in the Debug console.
  4. Notice that at one point, Debug console scrolls up quite a bit
  5. Scroll to bottom of Debug console output
  6. Run print(2) in Debug console.
  7. Notice that you don't see 2 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.)
6YmdHy3AB5

Thanks for the steps, I will look into this this or next week.

@bersbersbers we have pushed a fix with the help of @jeanp413
Please try it with VSCode insiders starting from Tuesday which will have the fix. Thank you

I have just checked

Version: 1.36.0-insider (user setup)
Commit: e80dd4f217db6e230d311a87fdf4276f740f6445
Date: 2019-06-25T05:19:01.461Z
Electron: 4.2.5
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362

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!

Was this page helpful?
0 / 5 - 0 ratings