Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

"debug" launch configuration seems to ignore the "cwd" launch.json configuration #710

Closed
ankon opened this issue Jan 5, 2017 · 4 comments

Comments

@ankon
Copy link
Contributor

ankon commented Jan 5, 2017

Version 1.9.0-insider
Commit 0347c19753f279a0c56ab2c8833de844f3be0e5d
Date 2017-01-04T07:03:01.691Z
Shell 1.4.6
Renderer 53.0.2785.143
Node 6.5.0
package main

import "fmt"
import "os"

func main() {
	cwd, _ := os.Getwd()
	fmt.Printf("CWD: %s\n", cwd)
}
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "remotePath": "",
            "port": 2345,
            "host": "127.0.0.1",
            "program": "${workspaceRoot}",
            "env": {},
            "args": [
                "validate"
            ],
            "showLog": true,
            "cwd": "/home"
        }
    ]
}

Expected behavior: prints "CWD: /home"
Actual behavior: prints "CWD: ...workspaceRoot"

@mattetti
Copy link
Contributor

+1 thanks @ankon

@ramya-rao-a
Copy link
Contributor

The fix is in the latest update (0.6.53)
Thanks @anton!

@nbys
Copy link

nbys commented Dec 8, 2017

Hi Ramya,
I noticed that cwd and env are ignored while debugging a test file. Is it possible to select the configuration for debugging test files?

@ramya-rao-a
Copy link
Contributor

@cxww107 AFAIK, the cwd set in the debug config in the launch.json file does get passed to delve regardless of whether you are debugging a test or a program. Please log a new issue with a sample code set and reproducible steps.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants