Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate file tab during debugging on Windows #4166

Closed
SimoPk opened this issue Jan 28, 2019 · 14 comments
Closed

Duplicate file tab during debugging on Windows #4166

SimoPk opened this issue Jan 28, 2019 · 14 comments
Assignees
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug

Comments

@SimoPk
Copy link

SimoPk commented Jan 28, 2019

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.

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Jan 28, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jan 28, 2019
@d3r3kk
Copy link

d3r3kk commented Jan 30, 2019

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.

@d3r3kk d3r3kk added bug Issue identified by VS Code Team member as probable bug area-debugging info-needed Issue requires more information from poster labels Jan 30, 2019
@ghost ghost removed info-needed Issue requires more information from poster triage labels Jan 30, 2019
@DonJayamanne
Copy link

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

@DonJayamanne DonJayamanne reopened this Jan 30, 2019
@DonJayamanne
Copy link

Upstream issue microsoft/vscode#12448

@SimoPk
Copy link
Author

SimoPk commented Jan 30, 2019

I'll provide the data you need later, but in the meantime I can tell you that I think the problem is that the path was maybe generated (by our IT department) as D:\users (with the lowercase u) and the through the desktop.ini it gets the localized folder name "Users" with the capital U.

image

I can't confirm that now (maybe I'll try in a virtual machine), but I suspect that the problem could arise also if, for example, a folder named "aaa" was localized through the desktop.ini to "Users".

Maybe somewhere in the codebase the localized path is compared with the physical one... just guessing...

In the meantime I've moved all my files to another folder outside D:\Users and it all works fine, so the problem is just with this particular path.

@mmanatane

This comment has been minimized.

@PescheHelfer

This comment has been minimized.

@erwanjolivet

This comment has been minimized.

@DonJayamanne
Copy link

DonJayamanne commented Apr 4, 2019

@mmanatane @Spitfirech** @erwanjolivet What you're experiencing is identical to #5049

@DonJayamanne
Copy link

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

@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label Apr 4, 2019
@DonJayamanne DonJayamanne self-assigned this Apr 4, 2019
@siriuspal
Copy link

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

@siriuspal
Copy link

Deleting .vscode folder did not help to resolve issue.

@pbs-websuntangled
Copy link

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

@brettcannon brettcannon added triage and removed info-needed Issue requires more information from poster needs upstream fix labels Apr 24, 2019
@DonJayamanne
Copy link

@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.

@pbs-websuntangled
Copy link

pbs-websuntangled commented May 14, 2019 via email

@ghost ghost removed the triage label May 16, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

10 participants