Commit 076ccdf

HPCesia <me@hpcesia.com>
2026-09-17 06:08:04
flyline: fix duplicate prompt on terminal resize
Assisted-by: crush:deepseek-v4.1-flash
1 parent 51b6e1a
Changed files (2)
pkgs/flyline/default.nix
@@ -19,6 +19,8 @@ rustPlatform.buildRustPackage (finalAttrs: {
   };
 
   cargoHash = "sha256-pf8JMBQxUoLjo7mpqFYa/yJpZc2ZJOZqMx0oMEKB7wA=";
+
+  patches = [./no-delete-line.patch];
   doCheck = false;
 
   # macOS-only: fix Mach-O reproducibility leaks and re-add -undefined
pkgs/flyline/no-delete-line.patch
@@ -0,0 +1,26 @@
+diff --git a/src/app/mod.rs b/src/app/mod.rs
+index e48e446..159b145 100644
+--- a/src/app/mod.rs
++++ b/src/app/mod.rs
+@@ -1054,21 +1054,6 @@ impl<'a> App<'a> {
+                                 );
+                             }
+ 
+-                            // Ive noticed that zellij maintains its "is_line_wrapped" state
+-                            // even when we clear and redraw the lines
+-                            // This causes miscalculations of number of rows to move up because
+-                            // zellij combines two lines into one when the terminal is widened
+-                            // but our logic thinks those two lines are still separate.
+-                            // I have found issuing delete line commands fixes it.
+-                            let delete_count = (rows_up as u32 + 1).min(winsize.rows as u32);
+-                            if delete_count > 0 {
+-                                use termina::escape::csi::{Csi, Edit};
+-                                let _ = crate::flush_stdout!(
+-                                    "{}",
+-                                    Csi::Edit(Edit::DeleteLine(delete_count))
+-                                );
+-                            }
+-
+                             self.terminal.reset_inline_cursor();
+ 
+                             self.terminal.clear().unwrap_or_else(|e| {