Skip to content

Debug console scrolls near top after each evaluated line after exception raised in debug console #70331

Closed

Description

@bersbersbers

Issue Type: Bug

See also microsoft/vscode-python#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 (05f146c, 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

Activity

  1. bersbersbers commented on Mar 12, 2019

    @bersbersbers
    Author

    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
    
  2. isidorn commented on Mar 13, 2019

    @isidorn

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

  3. added
    info-needed
    on Mar 13, 2019
  4. bersbersbers commented on Mar 13, 2019

    @bersbersbers
    Author

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

  5. isidorn commented on Mar 13, 2019

    @isidorn

    I can not reproduce with node.
    Don Jayamanne (@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?

  6. razhangwei commented on Mar 13, 2019

    @razhangwei

    I encountered exactly the same issue as bersbersbers.

  7. isidorn commented on Mar 13, 2019

    @isidorn

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

  8. bersbersbers commented on Mar 13, 2019

    @bersbersbers
    Author

    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.

  9. DonJayamanne commented on Mar 13, 2019

    @DonJayamanne
    Contributor

    Yes, I too can replicate this issue on my Mac

  10. isidorn commented on Mar 13, 2019

    @isidorn

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

  11. isidorn commented on Mar 13, 2019

    @isidorn

    After investigating and discussion with João Moreno (@joaomoreno) we figured out it is a dup of #68385

  12. 16 remaining items

  13. bersbersbers commented on May 24, 2019

    @bersbersbers
    Author

    Hi Isidor Nikolic (@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

  14. isidorn commented on May 27, 2019

    @isidorn

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

  15. added
    bug
    on Jun 10, 2019
  16. isidorn commented on Jun 10, 2019

    @isidorn

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

  17. bersbersbers commented on Jun 25, 2019

    @bersbersbers
    Author

    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!)

  18. isidorn commented on Jun 25, 2019

    @isidorn

    Thanks. Adding verified label. Let us know how it goes once you get the stable update.

  19. bersbersbers commented on Jul 3, 2019

    @bersbersbers
    Author

    Stable looks good to me, too, thanks!

  20. locked and limited conversation to collaborators on Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugdebugverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions