mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-25 14:05:41 -05:00
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:
parent
2234234ca9
commit
d39370514a
8 changed files with 50010 additions and 4 deletions
|
@ -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> {
|
||||
|
|
|
@ -49,6 +49,7 @@ ref_tests! {
|
|||
vttest_tab_clear_set
|
||||
zsh_tab_completion
|
||||
history
|
||||
grid_reset
|
||||
}
|
||||
|
||||
fn read_u8<P>(path: P) -> Vec<u8>
|
||||
|
|
50002
tests/ref/grid_reset/alacritty.recording
Normal file
50002
tests/ref/grid_reset/alacritty.recording
Normal file
File diff suppressed because it is too large
Load diff
1
tests/ref/grid_reset/grid.json
Normal file
1
tests/ref/grid_reset/grid.json
Normal file
File diff suppressed because one or more lines are too long
1
tests/ref/grid_reset/size.json
Normal file
1
tests/ref/grid_reset/size.json
Normal 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}
|
|
@ -1,4 +1,4 @@
|
|||
[1m[7m%[27m[1m[0m
[0m[27m[24m[J[0;30;101m UL [0m[0;37;100m ~/…/tests/ref/history [0m[0;30;101m issue-1244 [0m [K[?2004h
[0m[27m[24m[J[0;30;101m UL [0m[0;37;100m ~/…/tests/ref/history [0m[0;30;101m issue-1244 [0m f[90mor i in {50000..2}; do echo $i; done[39m[36Df[39mo[39mr[39m [39mi[39m [39mi[39mn[39m [39m{[39m5[39m0[39m0[39m0[39m0[39m.[39m.[39m2[39m}[39m;[39m [39md[39mo[39m [39me[39mc[39mh[39mo[39m [39m$[39mi[39m;[39m [39md[39mo[39mn[39me[?2004l
|
||||
[1m[7m%[27m[1m[0m
[0m[27m[24m[J[0;30;101m UL [0m[0;37;100m ~/…/tests/ref/history [0m[0;30;101m issue-1244 [0m [K[?2004hf[90mor i in {50000..2}; do echo $i; done[39m[36Df[39mo[39mr[39m [39mi[39m [39mi[39mn[39m [39m{[39m5[39m0[39m0[39m0[39m0[39m.[39m.[39m2[39m}[39m;[39m [39md[39mo[39m [39me[39mc[39mh[39mo[39m [39m$[39mi[39m;[39m [39md[39mo[39mn[39me[?2004l
|
||||
50000
|
||||
49999
|
||||
49998
|
||||
|
@ -49998,4 +49998,4 @@
|
|||
4
|
||||
3
|
||||
2
|
||||
[1m[7m%[27m[1m[0m
[0m[27m[24m[J[0;30;101m UL [0m[0;37;100m ~/…/tests/ref/history [0m[0;30;101m issue-1244 [0m [K[?2004h
|
||||
[1m[7m%[27m[1m[0m
[0m[27m[24m[J[0;30;101m UL [0m[0;37;100m ~/…/tests/ref/history [0m[0;30;101m issue-1244 [0m [K[?2004h
|
1
tests/ref/history/grid.json
Normal file
1
tests/ref/history/grid.json
Normal file
File diff suppressed because one or more lines are too long
|
@ -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}
|
Loading…
Reference in a new issue