use `CONIN$` instead of `/dev/tty` on windows

This commit is contained in:
justarandomgeek 2026-02-25 23:24:37 -05:00 committed by Fintan Halpenny
parent a1fd9e04fe
commit eea3617781
2 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
indistinguishable from `[::1]:8776`. Since a port number is always required indistinguishable from `[::1]:8776`. Since a port number is always required
along a host when providing an address, IPv6 addresses now always require along a host when providing an address, IPv6 addresses now always require
brackets to avoid confusion. brackets to avoid confusion.
- On Windows, use `CONIN$` to reopen the terminal input stream, instead of refusing
to launch an editor for `radicle-remote-helper`
## Deprecations ## Deprecations

View File

@ -162,6 +162,9 @@ impl Editor {
.write(true) .write(true)
.open("/dev/tty")?; .open("/dev/tty")?;
process::Stdio::from(tty) process::Stdio::from(tty)
} else if cfg!(windows) {
let tty = fs::OpenOptions::new().read(true).open("CONIN$")?;
process::Stdio::from(tty)
} else { } else {
return Err(io::Error::new( return Err(io::Error::new(
io::ErrorKind::Unsupported, io::ErrorKind::Unsupported,