delve icon indicating copy to clipboard operation
delve copied to clipboard

`DELVE_EDITOR` should support extra arguments

Open meain opened this issue 1 year ago • 1 comments
trafficstars

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

meain avatar Jan 05 '24 17:01 meain

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.

aarzilli avatar Jan 05 '24 18:01 aarzilli