radicle-heartwood-lfs/crates/radicle-cli
Lorenz Leutgeb 70fb0d3fef term: Use inquire for spawning the editor
`radicle-term` includes quite a lot of rather "low-level" logic to spawn
the preferred editor of the user. In particular, this logic is
platform-dependent and only works on Unix-like platforms.

Also, `radicle-term` already depends on `inquire` which features an
editor prompt. It is a cross-platform solution to spawn the editor.
This commit changes the implementation of `Editor` to be a wrapper of
`inquire::Editor`, keeping the interface mostly intact.

Downsides:
 - We cannot edit a file "in place" this way, instead we have to read
   it, as `inquire` only supports editing temporary files. This can also
   be viewed as a benefit, as we lessen the risk of corruption of these
   files.
 - `inquire::Editor` contains borrows, so it is quite cumbersome to
   extend it with a custom mechanism for looking up the preferred
   editor. The lookup logic was kept, but needs to be invoked by the
   caller. In the future we might consider just using the logic provided
   by `inquire` or requesting a change to `inquire`.
 - The prompt is a bit strange. It does not show the current state of
   the output, see <https://github.com/mikaelmello/inquire/issues/280>
   and <https://github.com/mikaelmello/inquire/pull/271>.
2025-07-23 10:30:33 +02:00
..
examples cli: improve default branch pick 2025-07-23 07:43:27 +01:00
src term: Use inquire for spawning the editor 2025-07-23 10:30:33 +02:00
tests cli: improve default branch pick 2025-07-23 07:43:27 +01:00
Cargo.toml chore: prepare crates release 2025-07-14 15:38:09 +01:00
build.rs repo: Move workspace crates into `crates` subdirectory 2025-06-09 15:09:21 +02:00