From 9b9956de2713aed7d1f6a5bb3f76d02dda4fa1c6 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 3 Jun 2026 23:13:10 +0200 Subject: pkgs/lf-make-map: Print the interactive selection mode to stderr Printing it to stdout is obviously nonsense (e.g. This breaks: `cd "$(lf-make-map interactive ~/*)"`). --- pkgs/by-name/lf/lf-make-map/src/mapping/interactive.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkgs/by-name/lf/lf-make-map/src/mapping') diff --git a/pkgs/by-name/lf/lf-make-map/src/mapping/interactive.rs b/pkgs/by-name/lf/lf-make-map/src/mapping/interactive.rs index 31324e1d..1ba3d5f8 100644 --- a/pkgs/by-name/lf/lf-make-map/src/mapping/interactive.rs +++ b/pkgs/by-name/lf/lf-make-map/src/mapping/interactive.rs @@ -8,7 +8,7 @@ // You should have received a copy of the License along with this program. // If not, see . -use std::{io::stdout, path::PathBuf}; +use std::{io::stderr, path::PathBuf}; use anyhow::Result; use crossterm::{ @@ -35,7 +35,7 @@ impl MappingsTrie { pub fn interactive_start(&self, home_path: PathBuf) -> Result<()> { terminal::enable_raw_mode()?; execute!( - stdout(), + stderr(), EnterAlternateScreen, PushKeyboardEnhancementFlags(KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES), MoveToRow(0) @@ -43,7 +43,7 @@ impl MappingsTrie { let output = self.interactive_start_inner(home_path); - execute!(stdout(), LeaveAlternateScreen, PopKeyboardEnhancementFlags)?; + execute!(stderr(), LeaveAlternateScreen, PopKeyboardEnhancementFlags)?; terminal::disable_raw_mode()?; match output? { @@ -70,7 +70,7 @@ impl MappingsTrie { terminal::disable_raw_mode()?; execute!( - stdout(), + stderr(), MoveUp($last_length as u16), Clear(ClearType::FromCursorDown), Print(format!("{}\n", path.display())) @@ -101,7 +101,7 @@ impl MappingsTrie { terminal::disable_raw_mode()?; let string = trie.to_string(); execute!( - stdout(), + stderr(), MoveUp(last_length as u16), Clear(ClearType::FromCursorDown), Print(format!( -- cgit v1.3.1