From 4e68a36141fe69e73c1f6e95f62ed1ab4a53260d Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 24 Jan 2026 01:41:24 +0100 Subject: [PATCH] terminal: name some enum fields --- src/reader/reader.rs | 5 +++-- src/screen.rs | 4 +++- src/terminal.rs | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/reader/reader.rs b/src/reader/reader.rs index 0fbbaf78f..ffc720852 100644 --- a/src/reader/reader.rs +++ b/src/reader/reader.rs @@ -863,8 +863,9 @@ fn read_i(parser: &Parser) { data.exit_loop_requested |= parser.libdata().exit_current_script; parser.libdata_mut().exit_current_script = false; - BufferedOutputter::new(Outputter::stdoutput()) - .write_command(Osc133CommandFinished(parser.get_last_status())); + BufferedOutputter::new(Outputter::stdoutput()).write_command(Osc133CommandFinished { + exit_status: parser.get_last_status(), + }); event::fire_generic(parser, L!("fish_postexec").to_owned(), vec![command]); // Allow any pending history items to be returned in the history array. data.history.resolve_pending(); diff --git a/src/screen.rs b/src/screen.rs index e58d24013..204813ee6 100644 --- a/src/screen.rs +++ b/src/screen.rs @@ -569,7 +569,9 @@ pub fn push_to_scrollback(&mut self) { } let mut out = BufferedOutputter::new(self.outp); // Move everything to scrollback. - out.write_command(ScrollContentUp(lines_to_scroll)); + out.write_command(ScrollContentUp { + lines: lines_to_scroll, + }); // Reposition cursor. out.write_command(CursorMove(CardinalDirection::Up, lines_to_scroll)); self.set_position_in_viewport("scrollback-push", Some(0)); diff --git a/src/terminal.rs b/src/terminal.rs index 95852e54c..5c80eecea 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -105,12 +105,12 @@ pub(crate) enum TerminalCommand<'a> { Osc133PromptStart, Osc133PromptEnd, Osc133CommandStart(&'a wstr), - Osc133CommandFinished(libc::c_int), + Osc133CommandFinished { exit_status: libc::c_int }, // Other terminal features QueryCursorPosition, QueryBackgroundColor, - ScrollContentUp(usize), + ScrollContentUp { lines: usize }, DecsetShowCursor, DecsetFocusReporting, @@ -184,10 +184,10 @@ fn write(out: &mut impl Output, sequence: &'static [u8]) -> bool { Osc133PromptStart => osc_133_prompt_start(self), Osc133PromptEnd => osc_133_prompt_end(self), Osc133CommandStart(command) => osc_133_command_start(self, command), - Osc133CommandFinished(s) => osc_133_command_finished(self, s), + Osc133CommandFinished { exit_status } => osc_133_command_finished(self, exit_status), QueryCursorPosition => write(self, b"\x1b[6n"), QueryBackgroundColor => write(self, b"\x1b]11;?\x1b\\"), - ScrollContentUp(lines) => scroll_content_up(self, lines), + ScrollContentUp { lines } => scroll_content_up(self, lines), DecsetShowCursor => write(self, b"\x1b[?25h"), DecsetFocusReporting => write(self, b"\x1b[?1004h"), DecrstFocusReporting => write(self, b"\x1b[?1004l"),