delve
delve copied to clipboard
`DELVE_EDITOR` should support extra arguments
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.
- What version of Delve are you using (
dlv version)? ...1.21.0 - What version of Go are you using? (
go version)? ...go1.21.3 - What operating system and processor architecture are you using? ...
linux/amd64 - What did you do? ... Run edit at a breakpoint with
DELVE_EDITORasemacsclient -n - What did you expect to see? ... Open Emacs to the location
- What did you see instead? ... Fails with message that
emacsclient -nis not a binary
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.