Reset grid content when running `reset`

In the current scrollback PR the `reset` command does not affect the
scrollback history. To make sure the terminal is properly reset, it
should clear the scrollback history.

This commit fixes this by creating a new and empty grid whenever `reset`
is executed. It takes the current dimensions and history size from the
old grid.

Right now there's an empty ref-test called `grid_reset` without any
content, this should be implemented once #1244 is resolved.

This fixes #1242.
This commit is contained in:
Christian Duerr 2018-04-14 17:37:57 +02:00 committed by Joe Wilm
parent 2234234ca9
commit d39370514a
8 changed files with 50010 additions and 4 deletions

View File

@ -13,7 +13,7 @@
/// done so manually.
use std::ops::{Index, IndexMut};
use index::{IndexRange, Line};
use index::Line;
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Storage<T> {

View File

@ -49,6 +49,7 @@ ref_tests! {
vttest_tab_clear_set
zsh_tab_completion
history
grid_reset
}
fn read_u8<P>(path: P) -> Vec<u8>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"width":1259.0,"height":1380.0,"cell_width":10.0,"cell_height":19.0,"padding_x":5.0,"padding_y":5.0}

View File

@ -1,4 +1,4 @@
%  UL  ~/…/tests/ref/history  issue-1244  [?2004h  UL  ~/…/tests/ref/history  issue-1244  for i in {50000..2}; do echo $i; donefor i in {50000..2}; do echo $i; done[?2004l
%  UL  ~/…/tests/ref/history  issue-1244  [?2004hfor i in {50000..2}; do echo $i; donefor i in {50000..2}; do echo $i; done[?2004l
50000
49999
49998
@ -49998,4 +49998,4 @@
4
3
2
%  UL  ~/…/tests/ref/history  issue-1244  [?2004h
%  UL  ~/…/tests/ref/history  issue-1244  [?2004h

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"width":2532.0,"height":1380.0,"cell_width":10.0,"cell_height":19.0,"padding_x":5.0,"padding_y":5.0}
{"width":1259.0,"height":1380.0,"cell_width":10.0,"cell_height":19.0,"padding_x":5.0,"padding_y":5.0}