From 8fb2d96b5cdbe629b2e25bb968c76c381b9f2be2 Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Tue, 10 Feb 2026 14:45:57 +0100 Subject: [PATCH] radicle/profile: No pager from Git on Windows Git for Windows horribly mangles the configured binaries through a POSIX `sh`-like environment even on Windows. We might be able to figure out which `sh.exe` we would have to execute on Windows, but this is too brittle. Windows users will have to use other mechanisms (like `$EDITOR` and `$PAGER`) to configure their programs. --- crates/radicle-term/src/editor.rs | 7 ++++++- crates/radicle/src/profile.rs | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/radicle-term/src/editor.rs b/crates/radicle-term/src/editor.rs index 4e275379..29b604fe 100644 --- a/crates/radicle-term/src/editor.rs +++ b/crates/radicle-term/src/editor.rs @@ -211,11 +211,16 @@ fn default_editor() -> Option { return Some(editor.into()); } } + // Check Git. The user might have configured their editor there. - #[cfg(feature = "git2")] + // On Windows, custom editors configured via Git are not supported, + // because of the complexity surrounding how the editor command is + // parsed and executed. See also . + #[cfg(all(feature = "git2", not(windows)))] if let Ok(path) = git2::Config::open_default().and_then(|cfg| cfg.get_path("core.editor")) { return Some(path.into_os_string()); } + // On macOS, `nano` is installed by default and it's what most users are used to // in the terminal. if cfg!(target_os = "macos") && exists("nano") { diff --git a/crates/radicle/src/profile.rs b/crates/radicle/src/profile.rs index 72ec2e60..fcb5f8a7 100644 --- a/crates/radicle/src/profile.rs +++ b/crates/radicle/src/profile.rs @@ -88,6 +88,10 @@ pub mod env { /// Get the configured pager program from the environment. pub fn pager() -> Option { + // On Windows, custom pagers configured via Git are not supported, + // because of the complexity surrounding how the pager command is + // parsed and executed. See also . + #[cfg(not(windows))] if let Ok(cfg) = crate::git::raw::Config::open_default() { if let Ok(pager) = cfg.get_string("core.pager") { return Some(pager);