Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
term/editor: add support for RAD_EDITOR
Open did:key:z6MksGpP...MGuV opened 1 month ago

This change adds support for determining the editor that should be opened by the RAD_EDITOR environment variable, which takes priority over both VISUAL and EDITOR, as it is specific to the radicle application.

This enables users to set a different editor specifically for radicle, which is useful in the event that the normal value for either VISUAL or EDITOR is a process that forks and exits early, but supports command line flags to modify this behavior and block on the main thread (e.g. neovim-remote, which the author uses).

did:key:z6MksGpP...MGuV opened with revision f01d19d7 on base 7bac1714 +6 -2 1 month ago

This change adds support for determining the editor that should be opened by the RAD_EDITOR environment variable, which takes priority over both VISUAL and EDITOR, as it is specific to the radicle application.

This enables users to set a different editor specifically for radicle, which is useful in the event that the normal value for either VISUAL or EDITOR is a process that forks and exits early, but supports command line flags to modify this behavior and block on the main thread (e.g. neovim-remote, which the author uses).

did:key:z6MksGpP...MGuV pushed revision 2 3bc78128 on base 7bac1714 +6 -2 1 month ago
fintohaps commented on revision 1 1 month ago

Hey, thanks for the contribution!

I understand why this may be useful; you gave a good example below!

However, I’m going to push back on this a bit because this would mean that we need to maintain support for RAD_EDITOR.

I’m wondering if there are any other ways in which you could do this, e.g.:

  • Prefix calling rad with EDITOR – might be verbose for you.
  • Setting Editor when you’re in Radicle repositories – might be annoying to then switch the editor when you want the forked process.
  • Some hook to set EDITOR when calling rad – I’m not sure what that would be, maybe a shell function?