Skip to content

arguments in launch.json not work in code-server #4362

Closed
@aiziyuer

Description

@aiziyuer

OS/Web Information

  • Web Browser: Google Chrome 92.0.4515.159
  • Local OS: Windows 10 Professional Workstation Edition 21H1
  • Remote OS: Red Hat Enterprise Linux release 8.4 (Ootpa)
  • Remote Architecture: x86_64
  • code-server --version: 3.12.0 b37ff28

Steps to Reproduce

  1. create a project
mkdir -p code-server-debug-args
mkdir -p code-server-debug-args/.vscode
  1. create launch.json(the arguments is myargs)
cat <<'EOF'>.vscode/launch.json
{
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "${fileDirname}",
            "args": [
                "myargs"
            ]
        }
    ]
}
EOF
  1. create main.go
cat <<'EOF'>main.go
package main

import (
	"fmt"
	"os"
)

func main() {
	fmt.Print(os.Args)
}
EOF
  1. create go.mod
cat <<'EOF'>go.mod # optional
module app

go 1.15
EOF
  1. debug in code-server

the project above can be download on https://github.com/aiziyuer/code-server-debug-args.

Expected

the test program shoud output my args myargs

[/tmp/__debug_bin458249886 myargs]

Actual

Case 01: go run

➜  code-server-debug-args git:(master) ✗ go run main.go myargs
[/tmp/go-build412015233/b001/exe/main myargs]

Case 02: debug in vscode(remote ssh)

Starting: /root/go/bin/dlv-dap dap --check-go-version=false --listen=127.0.0.1:41885 --log-dest=3 from /opt/code-server-debug-args
DAP server listening at: 127.0.0.1:41885
[/tmp/__debug_bin458249886 myargs]

Case 03: debug in code-server

Starting: /root/go/bin/dlv-dap dap --check-go-version=false --listen=127.0.0.1:33611 --log-dest=3 from /opt/code-server-debug-args
DAP server listening at: 127.0.0.1:33611
[/tmp/__debug_bin3637673742]

Logs

Screenshot

Notes

This issue can be reproduced in VS Code: Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions