question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

arguments in launch.json not work in code-server

See original GitHub issue

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 b37ff28a0a582aee84a8f961755d0cb40a4081db

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
chrirauchcommented, Oct 29, 2021

same here with php debugging… launch.json seems to be ignored. As a workaround, instead of downgrading, i added the launch configuration directly in the server settings.json

1reaction
bbrendoncommented, Jan 4, 2022

@jsjoeio Negatory. I’m scared to try different versions because something new always breaks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

arguments in launch.json not work in code-server · Issue #4362
I recently came across the same issue in my code-server (Version: 3.12.0 on Ubuntu 18.04). The lanch.json file seems doesn't work while ...
Read more >
Configure launch.json for C/C++ debugging in Visual Studio ...
Visual Studio Code generates a launch.json (under a .vscode folder in your project) ... For attach , this parameter does not change the...
Read more >
In VS Code I just can't get command line arguments in launch ...
json file is where you specify commain line arguments but for the life of it, I can't get that working. It looks as...
Read more >
Setup VSCode | EECS 280 Tutorials - GitHub Pages
To run a program with options or arguments in VS Code, edit launch.json . Be sure to put each option or argument as...
Read more >
FAQ - code-server v4.8.0 docs - Coder
Frequently asked questions on installing and running code-server.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found