From 263469755c56fa79474be2a56f2c85478cb1e25e Mon Sep 17 00:00:00 2001 From: benodiwal Date: Thu, 18 Dec 2025 05:50:47 +0530 Subject: [PATCH] refactor: remove unused stream handler scroll-to-bottom code The renderer approach doesn't need termio changes. Co-Authored-By: Sachin --- src/Surface.zig | 2 -- src/termio/Termio.zig | 3 --- src/termio/stream_handler.zig | 9 --------- 3 files changed, 14 deletions(-) diff --git a/src/Surface.zig b/src/Surface.zig index fea5b2a87..6e01daba2 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -1076,8 +1076,6 @@ pub fn handleMessage(self: *Surface, msg: Message) !void { }, .unlocked); }, - .report_color_scheme => |force| self.reportColorScheme(force), - .present_surface => try self.presentSurface(), .password_input => |v| try self.passwordInput(v), diff --git a/src/termio/Termio.zig b/src/termio/Termio.zig index a5b3cbed3..dee58dc22 100644 --- a/src/termio/Termio.zig +++ b/src/termio/Termio.zig @@ -166,7 +166,6 @@ pub const DerivedConfig = struct { clipboard_write: configpkg.ClipboardAccess, enquiry_response: []const u8, conditional_state: configpkg.ConditionalState, - scroll_to_bottom: configpkg.Config.ScrollToBottom, pub fn init( alloc_gpa: Allocator, @@ -208,7 +207,6 @@ pub const DerivedConfig = struct { .clipboard_write = config.@"clipboard-write", .enquiry_response = try alloc.dupe(u8, config.@"enquiry-response"), .conditional_state = config._conditional_state, - .scroll_to_bottom = config.@"scroll-to-bottom", // This has to be last so that we copy AFTER the arena allocations // above happen (Zig assigns in order). @@ -303,7 +301,6 @@ pub fn init(self: *Termio, alloc: Allocator, opts: termio.Options) !void { .enquiry_response = opts.config.enquiry_response, .default_cursor_style = opts.config.cursor_style, .default_cursor_blink = opts.config.cursor_blink, - .scroll_to_bottom_on_output = opts.config.scroll_to_bottom.output, }; const thread_enter_state = try ThreadEnterState.create( diff --git a/src/termio/stream_handler.zig b/src/termio/stream_handler.zig index 76de83c08..bc3edd185 100644 --- a/src/termio/stream_handler.zig +++ b/src/termio/stream_handler.zig @@ -56,9 +56,6 @@ pub const StreamHandler = struct { /// The clipboard write access configuration. clipboard_write: configpkg.ClipboardAccess, - /// The scroll-to-bottom behavior configuration. - scroll_to_bottom_on_output: bool, - //--------------------------------------------------------------- // Internal state @@ -115,7 +112,6 @@ pub const StreamHandler = struct { self.enquiry_response = config.enquiry_response; self.default_cursor_style = config.cursor_style; self.default_cursor_blink = config.cursor_blink; - self.scroll_to_bottom_on_output = config.scroll_to_bottom.output; // If our cursor is the default, then we update it immediately. if (self.default_cursor) self.setCursorStyle(.default) catch |err| { @@ -580,11 +576,6 @@ pub const StreamHandler = struct { // Small optimization: call index instead of linefeed because they're // identical and this avoids one layer of function call overhead. try self.terminal.index(); - - // If configured, scroll to bottom on output so the user sees new content - if (self.scroll_to_bottom_on_output) { - try self.terminal.scrollViewport(.bottom); - } } pub inline fn reverseIndex(self: *StreamHandler) !void {