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

DELVE_EDITOR should support extra arguments #3627

Open
meain opened this issue Jan 5, 2024 · 1 comment
Open

DELVE_EDITOR should support extra arguments #3627

meain opened this issue Jan 5, 2024 · 1 comment

Comments

@meain
Copy link

meain commented Jan 5, 2024

As of now, DELVE_EDITOR expects just a binary name, but it would be useful if it could also accept extra arguments. For example, with Emacs, I would want the editor to be something like emacsclient -c so that it creates a new frame. This is the behavior with GIT_EDITOR btw. I think the logic in git is to split the env var by space. If this sounds good, I can probably drop a PR with the change. As a workaround I currently have it call a shell script which in turn calls emacsclient with proper args.


  1. What version of Delve are you using (dlv version)? ... 1.21.0
  2. What version of Go are you using? (go version)? ... go1.21.3
  3. What operating system and processor architecture are you using? ... linux/amd64
  4. What did you do? ... Run edit at a breakpoint with DELVE_EDITOR as emacsclient -n
  5. What did you expect to see? ... Open Emacs to the location
  6. What did you see instead? ... Fails with message that emacsclient -n is not a binary
@aarzilli
Copy link
Member

aarzilli commented Jan 5, 2024

The documentation of GIT_EDITOR actually says:

       GIT_EDITOR
           Text editor for use by Git commands. The value is meant to be
           interpreted by the shell when it is used.

Also it would have to support something to pass filename and line number. The easiest way to do whatever you want to do is to write a wrapper script and set that as DELVE_EDITOR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants