From 37e991b7eb1f57090b98ebc02a7fad6a4971e876 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 8 Dec 2025 20:11:22 +0800 Subject: Add jvii binary and set default text editor - Add jvii as a new binary target in Cargo configuration - Set JV_TEXT_EDITOR environment variable to "nano" in CLI scripts - Implement jvii binary with version command support - Add get_default_editor() utility that checks JV_TEXT_EDITOR, EDITOR, then defaults to "jvii" --- src/utils/input.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/utils/input.rs') diff --git a/src/utils/input.rs b/src/utils/input.rs index 219fe1b..1edcc5d 100644 --- a/src/utils/input.rs +++ b/src/utils/input.rs @@ -1,5 +1,7 @@ use tokio::{fs, process::Command}; +use crate::utils::env::get_default_editor; + /// Confirm the current operation /// Waits for user input of 'y' or 'n' pub async fn confirm_hint(text: impl Into) -> bool { @@ -69,7 +71,7 @@ pub async fn input_with_editor( fs::write(cache_path, default_content).await?; // Get editor from environment variable - let editor = std::env::var("EDITOR").unwrap_or_else(|_| "vi".to_string()); + let editor = get_default_editor().await; // Open editor with cache file let status = Command::new(editor).arg(cache_path).status().await?; -- cgit