diff --git a/src/tests/fixtures/fzf_fullscreen b/src/tests/fixtures/fzf_fullscreen new file mode 100755 index 0000000000..a97358f1cb --- /dev/null +++ b/src/tests/fixtures/fzf_fullscreen @@ -0,0 +1,6 @@ +Welcome to fish, the friendly interactive shell +Type `help` for instructions on how to use fish +[?2004h]0;fish /home/thomas/Projects/zellij(B  +zellij on  fix/fzf-crash [$!?] is 📦 v0.25.0 via 🦀 v1.58.1  +❯  f f (Bzf (Bzf (Bf (Bfzf (B  +(B[?2004l]0;fzf /home/thomas/Projects/zellij(B [?1049h[?1000h                                                                                                       >   ⠹ 0/0   ⠹ 0/2419    ⠹ 2419/2419   src/tests/fixtures/fish_and_bandwhich   src/tests/fixtures/exa_plus_omf_theme   src/tests/fixtures/emacs_longbuf_tutorial   src/tests/fixtures/clear_scroll_region   src/tests/fixtures/bash_cursor_linewrap   example/themes/tokyo-night.yaml   example/default.yaml   example/alt-centered-config.yaml   example/tmux-overview.yaml   example/layouts/run_htop_layout_with_plugins.yaml   example/layouts/multiple_tabs_layout_htop_command.yaml   example/layouts/multiple_tabs_layout.yaml   example/layouts/run_htop_layout.yaml   example/config.yaml   example/tmux.nonfunctional   example/screen.nonfunctional   example/screen-overview.yaml   example/README.md   docs/MANPAGE.md   docs/ARCHITECTURE.md   docs/TERMINOLOGY.md   default-plugins/tab-bar/Cargo.toml   default-plugins/tab-bar/src/tab.rs   default-plugins/tab-bar/src/main.rs   default-plugins/tab-bar/src/line.rs   default-plugins/tab-bar/LICENSE.md   default-plugins/strider/Cargo.toml   default-plugins/strider/src/state.rs   default-plugins/strider/src/main.rs   default-plugins/strider/LICENSE.md   default-plugins/status-bar/Cargo.toml   default-plugins/status-bar/src/second_line.rs   default-plugins/status-bar/src/first_line.rs   default-plugins/status-bar/src/main.rs   default-plugins/status-bar/src/tip/utils.rs   default-plugins/status-bar/src/tip/mod.rs   default-plugins/status-bar/src/tip/data.rs   default-plugins/status-bar/src/tip/consts.rs   default-plugins/status-bar/src/tip/cache.rs   default-plugins/status-bar/LICENSE.md   assets/multiplayer-sessions.gif   assets/zellij.desktop   assets/demo.gif   assets/plugins/status-bar.wasm   assets/plugins/tab-bar.wasm   assets/plugins/strider.wasm   assets/logo.png   LICENSE.md > CODE_OF_CONDUCT.md   ⠹ 2419/12288   12363/12363   12363/12363  \ No newline at end of file diff --git a/zellij-server/src/panes/grid.rs b/zellij-server/src/panes/grid.rs index 8669cfe661..ab472aeac3 100644 --- a/zellij-server/src/panes/grid.rs +++ b/zellij-server/src/panes/grid.rs @@ -1875,7 +1875,10 @@ impl Perform for Grid { &mut self.lines_above, VecDeque::with_capacity(*SCROLL_BUFFER_SIZE.get().unwrap()), ); - let current_viewport = std::mem::take(&mut self.viewport); + let current_viewport = std::mem::replace( + &mut self.viewport, + vec![Row::new(self.width).canonical()], + ); let current_cursor = std::mem::replace(&mut self.cursor, Cursor::new(0, 0)); self.alternate_lines_above_viewport_and_cursor = Some((current_lines_above, current_viewport, current_cursor)); diff --git a/zellij-server/src/panes/unit/grid_tests.rs b/zellij-server/src/panes/unit/grid_tests.rs index 7fbfd11924..57e97725dd 100644 --- a/zellij-server/src/panes/unit/grid_tests.rs +++ b/zellij-server/src/panes/unit/grid_tests.rs @@ -1106,3 +1106,15 @@ pub fn alternate_screen_change_size() { assert_snapshot!(format!("{:?}", grid)); assert_eq!(grid.scrollback_position_and_length(), (0, 0)) } + +#[test] +pub fn fzf_fullscreen() { + let mut vte_parser = vte::Parser::new(); + let mut grid = Grid::new(51, 112, Palette::default()); + let fixture_name = "fzf_fullscreen"; + let content = read_fixture(fixture_name); + for byte in content { + vte_parser.advance(&mut grid, byte); + } + assert_snapshot!(format!("{:?}", grid)); +} diff --git a/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__fzf_fullscreen.snap b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__fzf_fullscreen.snap new file mode 100644 index 0000000000..13aac7abf7 --- /dev/null +++ b/zellij-server/src/panes/unit/snapshots/zellij_server__panes__grid__grid_tests__fzf_fullscreen.snap @@ -0,0 +1,57 @@ +--- +source: zellij-server/src/panes/./unit/grid_tests.rs +expression: "format!(\"{:?}\", grid)" + +--- +00 (C): src/tests/fixtures/fish_and_bandwhich +01 (C): src/tests/fixtures/exa_plus_omf_theme +02 (C): src/tests/fixtures/emacs_longbuf_tutorial +03 (C): src/tests/fixtures/clear_scroll_region +04 (C): src/tests/fixtures/bash_cursor_linewrap +05 (C): example/themes/tokyo-night.yaml +06 (C): example/default.yaml +07 (C): example/alt-centered-config.yaml +08 (C): example/tmux-overview.yaml +09 (C): example/layouts/run_htop_layout_with_plugins.yaml +10 (C): example/layouts/multiple_tabs_layout_htop_command.yaml +11 (C): example/layouts/multiple_tabs_layout.yaml +12 (C): example/layouts/run_htop_layout.yaml +13 (C): example/config.yaml +14 (C): example/tmux.nonfunctional +15 (C): example/screen.nonfunctional +16 (C): example/screen-overview.yaml +17 (C): example/README.md +18 (C): docs/MANPAGE.md +19 (C): docs/ARCHITECTURE.md +20 (C): docs/TERMINOLOGY.md +21 (C): default-plugins/tab-bar/Cargo.toml +22 (C): default-plugins/tab-bar/src/tab.rs +23 (C): default-plugins/tab-bar/src/main.rs +24 (C): default-plugins/tab-bar/src/line.rs +25 (C): default-plugins/tab-bar/LICENSE.md +26 (C): default-plugins/strider/Cargo.toml +27 (C): default-plugins/strider/src/state.rs +28 (C): default-plugins/strider/src/main.rs +29 (C): default-plugins/strider/LICENSE.md +30 (C): default-plugins/status-bar/Cargo.toml +31 (C): default-plugins/status-bar/src/second_line.rs +32 (C): default-plugins/status-bar/src/first_line.rs +33 (C): default-plugins/status-bar/src/main.rs +34 (C): default-plugins/status-bar/src/tip/utils.rs +35 (C): default-plugins/status-bar/src/tip/mod.rs +36 (C): default-plugins/status-bar/src/tip/data.rs +37 (C): default-plugins/status-bar/src/tip/consts.rs +38 (C): default-plugins/status-bar/src/tip/cache.rs +39 (C): default-plugins/status-bar/LICENSE.md +40 (C): assets/multiplayer-sessions.gif +41 (C): assets/zellij.desktop +42 (C): assets/demo.gif +43 (C): assets/plugins/status-bar.wasm +44 (C): assets/plugins/tab-bar.wasm +45 (C): assets/plugins/strider.wasm +46 (C): assets/logo.png +47 (C): LICENSE.md +48 (C): > CODE_OF_CONDUCT.md +49 (C): 12363/12363 +50 (C): > +