Skip to content

Duplicate file tab during debugging on Windows #4166

Closed

Description

@SimoPk

Environment data

  • VS Code version: 1.30.2
  • Extension version (available under the Extensions sidebar): 2018.12.1
  • OS and version: MS Windows 7
  • Python version (& distribution if applicable, e.g. Anaconda): Miniconda 3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda

Expected behaviour

When hitting a breakpoint during debug, the corresponding line in the already opened source file should be highlighted

Actual behaviour

A new tab is opened with the correct file, so I have two tabs with the same file.

This is before starting the debugger
1

This is with the debugger running
2

Two tabs with a.py are opened, and debugging starts in the second tab, (you can also see that the breakpoint is hit but the red dot indicating breakpoint is not there; it is in the other window and the breakpoints for the two windows are independent)

Reading from the internet, I think it's because somewhere the path of the file is treated as case-sensitive..

[EDIT] it is in fact something related to casing, because I noticed that somehow the path to my user folder (on which btw I kept all my source code) is D:\users<username> (notice the lowercase U), while VSCode opens the files on D:\Users<username><folder>\a.py. Doing the same test is a folder on another location (like D:_DEV\a.py) doesn't show this issue.

Activity

  1. ghost added
    triage-neededNeeds assignment to the proper sub-team
    on Jan 28, 2019
  2. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Jan 28, 2019
  3. d3r3kk commented on Jan 30, 2019

    @d3r3kk

    This is perhaps a duplicate of #3185 but I'll leave it open as it describes a situation where we see the duplicate tabs without remote debugging.

    I cannot seem to reproduce on my Windows 10 machines, but since this is windows 7 I am wondering if there is some discrepancy in how Python specifies its platform there.

    SimoPk could you please provide a bit more information for us? We are having a tough time reproducing this behaviour ourselves.

    • Run this command in your virtual environment and paste the output here. (I'm looking at ptvsd/pathutils.py here)
      • python -c "import platform; print(platform.system())"
    • Copy/paste the full contents of your terminal after debugging and observing this behaviour.
    • Run the command 'Python: Enable Source Maps', reload the extension, then re-run the debugging session and paste the contents of your Developer Tools window (Help -> Toggle Developer Tools) here.
    • Paste the contents of the Output:Python window here.
  4. ghost removed
    info-neededIssue requires more information from poster
    on Jan 30, 2019
  5. ghost removed on Jan 30, 2019
  6. DonJayamanne commented on Jan 30, 2019

    @DonJayamanne

    Lets keep this opened, to ensure we do not forget about the fact that users have issues with mixed casings in folder names.

  7. 11 remaining items

  8. DonJayamanne commented on Apr 4, 2019

    @DonJayamanne

    SimoPk Apologies for getting back so late, but would like to check whether this is still an issue for you.
    If it is, please could you:

    • Let me know what the actual path is in your file system (outside VS Code), from windows folder
    • Open VS Code, open the file, hover over the file tab and check the tooltip (or right click and select Copy Path) and let me know whether the casing for the file path is correct or not.
    • Next, when debugging, and the duplicate window is opened, let me know the full path to the file thats opened (hover over file tab to check tooltip - or right click and select Copy Path)
  9. siriuspal commented on Apr 5, 2019

    @siriuspal

    This is an issue for me in Windows 10.
    This happened on my project folder. Unfortunately when I tried to replicate this in a "test folder" to report, I could not.
    But it always triggers a duplicate window in my project folder.

    Here is folder structure (with names changed for hiding project info) where issue is present:

    1. File path from windows explorer: D:\Projects\ABC\Example\my_beautiful_project
    2. Copy path original: D:\Projects\ABC\Example\my_beautiful_project\test.py
    3. Copy path duplicate window: D:\Projects\ABC\example\my_beautiful_project\test.py

    Note: Example folder is all small.

    Here are folder structure where issue could not be reproduced

    1. D:\Somefolder\reproduce_issue
    2. D:\somefolder\reproduce_issue\test.py

    I tried to add one more layer of capitalized folder to check if issue can be reproduced, but could not.
    D:\somefolder\onemorecapfolder\reproduce_issue\test.py

    I tried further - opened the folder same way - right click Open in VScode from explorer still could not reproduce.
    D:\Somefolder\ABC\Onemorecapfolder\reproduce_issue

  10. siriuspal commented on Apr 5, 2019

    @siriuspal

    Deleting .vscode folder did not help to resolve issue.

  11. pbs-websuntangled commented on Apr 6, 2019

    @pbs-websuntangled

    I have the same problem using windows 10 pro build 17134

    I attach an image showing the duplicate copies open with their own tabs

    Screenshot (28)

    It happens when I am debugging and started a few weeks ago.

    On the lhs in the file window, you can see it's showing the open tabs and the 2nd copy of database functions is listed with its path and the path is all lower case.

    None of the other files have their path shown and the path of the folder according to windows has an upper case D in Documents

  12. DonJayamanne commented on May 14, 2019

    @DonJayamanne

    Peter Brookes-Smith (@pbs-websuntangled) @skbobade
    We've added a few fixes to this area of the debugger, please could you test this with the latest version of the extension and let me know whether the issues have been resolved.

  13. pbs-websuntangled commented on May 14, 2019

    @pbs-websuntangled
  14. ghost removed on May 16, 2019
  15. locked as resolved and limited conversation to collaborators on Jun 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-debuggingbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions