XIVN1987

vscode remote wsl 调试时,对同一个文件打开两个编辑器视图

  •  
  •   XIVN1987 · Nov 28, 2019 · 3289 views
    This topic created in 2390 days ago, the information mentioned may be changed or developed.
    在 vscode 左侧浏览器窗口双击 main.c,会在编辑器窗口打开 /root/win/studyC/main.c

    然后按 F5 进入调试状态,vscode 会自动在编辑器窗口中打开 /mnt/d/Program/Ubuntu/studyC/main.c

    但这两个文件其实是同一个文件,因为 /root/win 其实是个软链接,指向 /mnt/d/Program/Ubuntu

    请问这个问题如何解决??
    XIVN1987
        1
    XIVN1987  
    OP
       Aug 21, 2021
    找到解决方法了:
    打开 vscode 目录的时候用“code /mnt/d/Program/Ubuntu/studyC”,这样在左侧 Explore 窗口双击打开的 main.c 路径就是“/mnt/d/Program/Ubuntu/studyC/main.c”,,进入调试状态的时候就不会再打开一个 main.c 的编辑器视图了

    总之就是 vscode 使用 remote wsl 插件打开文件夹的时候,要使用"/mnt/d/***"这样的路径,而不要使用“ln -s”创建的软连接
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2742 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 11:54 · PVG 19:54 · LAX 04:54 · JFK 07:54
    ♥ Do have faith in what you're doing.