fix(compatibility): properly fill viewport with styles when clearing it (#493)

This commit is contained in:
Aram Drevekenin 2021-05-12 11:27:53 +02:00 committed by GitHub
parent 830e963d6f
commit 9bb300e1c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 596 additions and 143 deletions

View File

@ -31,12 +31,17 @@ pub enum ClientInstruction {
}
pub fn start_client(mut os_input: Box<dyn ClientOsApi>, opts: CliArgs, config: Config) {
let clear_client_terminal_attributes = "\u{1b}[?1l\u{1b}=\u{1b}[r\u{1b}12l\u{1b}[?1000l\u{1b}[?1002l\u{1b}[?1003l\u{1b}[?1005l\u{1b}[?1006l";
let take_snapshot = "\u{1b}[?1049h";
os_input.unset_raw_mode(0);
let _ = os_input
.get_stdout_writer()
.write(take_snapshot.as_bytes())
.unwrap();
let _ = os_input
.get_stdout_writer()
.write(clear_client_terminal_attributes.as_bytes())
.unwrap();
std::env::set_var(&"ZELLIJ", "0");
let mut command_is_executing = CommandIsExecuting::new();

View File

@ -1056,7 +1056,7 @@ impl Perform for Grid {
} else if clear_type == 1 {
self.clear_all_before_cursor(char_to_replace);
} else if clear_type == 2 {
self.clear_all(char_to_replace);
self.fill_viewport(char_to_replace);
}
};
} else if c == 'H' || c == 'f' {

View File

@ -25,4 +25,23 @@ expression: "format!(\"{:?}\", grid)"
19 (C):
20 (C):
21 (C):
22 (C):
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -25,4 +25,23 @@ expression: "format!(\"{:?}\", grid)"
19 (C):
20 (C):
21 (C):
22 (C):
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -3,28 +3,45 @@ source: src/client/panes/./unit/grid_tests.rs
expression: "format!(\"{:?}\", grid)"
---
00 (W):
01 (W):
02 (W):
03 (W):
04 (W):
05 (W):
06 (W):
07 (W):
08 (W):
09 (W):
10 (W):
11 (W):
12 (W):
13 (W):
14 (W):
15 (W):
16 (W):
17 (W):
18 (W):
19 (W):
20 (W):
21 (W):
22 (W): This line should be the one above the bottom of the screen. Push <RETURN>
23 (W): Origin mode test. This line should be at the bottom of the screen.
00 (C):
01 (C):
02 (C):
03 (C):
04 (C):
05 (C):
06 (C):
07 (C):
08 (C):
09 (C):
10 (C):
11 (C):
12 (C):
13 (C):
14 (C):
15 (C):
16 (C):
17 (C):
18 (C):
19 (C):
20 (C):
21 (C):
22 (C): This line should be the one above the bottom of the screen. Push <RETURN>
23 (C): Origin mode test. This line should be at the bottom of the screen.
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -3,28 +3,45 @@ source: src/client/panes/./unit/grid_tests.rs
expression: "format!(\"{:?}\", grid)"
---
00 (W): This line should be at the top of the screen. Push <RETURN>
01 (W):
02 (W):
03 (W):
04 (W):
05 (W):
06 (W):
07 (W):
08 (W):
09 (W):
10 (W):
11 (W):
12 (W):
13 (W):
14 (W):
15 (W):
16 (W):
17 (W):
18 (W):
19 (W):
20 (W):
21 (W):
22 (W):
23 (W): Origin mode test. This line should be at the bottom of the screen.
00 (C): This line should be at the top of the screen. Push <RETURN>
01 (C):
02 (C):
03 (C):
04 (C):
05 (C):
06 (C):
07 (C):
08 (C):
09 (C):
10 (C):
11 (C):
12 (C):
13 (C):
14 (C):
15 (C):
16 (C):
17 (C):
18 (C):
19 (C):
20 (C):
21 (C):
22 (C):
23 (C): Origin mode test. This line should be at the bottom of the screen.
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -3,28 +3,45 @@ source: src/client/panes/./unit/grid_tests.rs
expression: "format!(\"{:?}\", grid)"
---
00 (W): Graphic rendition test pattern:
01 (W):
02 (W):
03 (W): vanilla bold
04 (W):
05 (W): underline bold underline
06 (W):
07 (W): blink bold blink
08 (W):
09 (W): underline blink bold underline blink
10 (W):
11 (W): negative bold negative
12 (W):
13 (W): underline negative bold underline negative
14 (W):
15 (W): blink negative bold blink negative
16 (W):
17 (W): underline blink negative bold underline blink negative
18 (W):
19 (W):
20 (W):
21 (W):
22 (W): Dark background. Push <RETURN>
23 (W):
00 (C): Graphic rendition test pattern:
01 (C):
02 (C):
03 (C): vanilla bold
04 (C):
05 (C): underline bold underline
06 (C):
07 (C): blink bold blink
08 (C):
09 (C): underline blink bold underline blink
10 (C):
11 (C): negative bold negative
12 (C):
13 (C): underline negative bold underline negative
14 (C):
15 (C): blink negative bold blink negative
16 (C):
17 (C): underline blink negative bold underline blink negative
18 (C):
19 (C):
20 (C):
21 (C):
22 (C): Dark background. Push <RETURN>
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -3,28 +3,45 @@ source: src/client/panes/./unit/grid_tests.rs
expression: "format!(\"{:?}\", grid)"
---
00 (W): Graphic rendition test pattern:
01 (W):
02 (W):
03 (W): vanilla bold
04 (W):
05 (W): underline bold underline
06 (W):
07 (W): blink bold blink
08 (W):
09 (W): underline blink bold underline blink
10 (W):
11 (W): negative bold negative
12 (W):
13 (W): underline negative bold underline negative
14 (W):
15 (W): blink negative bold blink negative
16 (W):
17 (W): underline blink negative bold underline blink negative
18 (W):
19 (W):
20 (W):
21 (W):
22 (W): Light background. Push <RETURN>
23 (W):
00 (C): Graphic rendition test pattern:
01 (C):
02 (C):
03 (C): vanilla bold
04 (C):
05 (C): underline bold underline
06 (C):
07 (C): blink bold blink
08 (C):
09 (C): underline blink bold underline blink
10 (C):
11 (C): negative bold negative
12 (C):
13 (C): underline negative bold underline negative
14 (C):
15 (C): blink negative bold blink negative
16 (C):
17 (C): underline blink negative bold underline blink negative
18 (C):
19 (C):
20 (C):
21 (C):
22 (C): Light background. Push <RETURN>
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -3,28 +3,45 @@ source: src/client/panes/./unit/grid_tests.rs
expression: "format!(\"{:?}\", grid)"
---
00 (W): AAAAA
01 (W): AAAAA
02 (W): AAAAA
03 (W): AAAAA
04 (W):
05 (W):
06 (W):
07 (W): normal bold underscored blinking reversed
08 (W):
09 (W): stars: ********** ********** ********** ********** **********
10 (W):
11 (W): line: ────────── ────────── ────────── ────────── ──────────
12 (W):
13 (W): x'es: xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx
14 (W):
15 (W): diamonds: ◆◆◆◆◆◆◆◆◆◆ ◆◆◆◆◆◆◆◆◆◆ ◆◆◆◆◆◆◆◆◆◆ ◆◆◆◆◆◆◆◆◆◆ ◆◆◆◆◆◆◆◆◆◆
16 (W):
17 (W):
18 (W):
19 (W):
20 (W): Test of the SAVE/RESTORE CURSOR feature. There should
21 (W): be ten characters of each flavour, and a rectangle
22 (W): of 5 x 4 A's filling the top left of the screen.
23 (W): Push <RETURN>
00 (C): AAAAA
01 (C): AAAAA
02 (C): AAAAA
03 (C): AAAAA
04 (C):
05 (C):
06 (C):
07 (C): normal bold underscored blinking reversed
08 (C):
09 (C): stars: ********** ********** ********** ********** **********
10 (C):
11 (C): line: ────────── ────────── ────────── ────────── ──────────
12 (C):
13 (C): x'es: xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx
14 (C):
15 (C): diamonds: ◆◆◆◆◆◆◆◆◆◆ ◆◆◆◆◆◆◆◆◆◆ ◆◆◆◆◆◆◆◆◆◆ ◆◆◆◆◆◆◆◆◆◆ ◆◆◆◆◆◆◆◆◆◆
16 (C):
17 (C):
18 (C):
19 (C):
20 (C): Test of the SAVE/RESTORE CURSOR feature. There should
21 (C): be ten characters of each flavour, and a rectangle
22 (C): of 5 x 4 A's filling the top left of the screen.
23 (C): Push <RETURN>
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -25,4 +25,23 @@ expression: "format!(\"{:?}\", grid)"
19 (C): This is 132 column mode, light background.Push <RETURN>
20 (C):
21 (C):
22 (C):
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -25,4 +25,23 @@ expression: "format!(\"{:?}\", grid)"
19 (C): This is 80 column mode, light background.Push <RETURN>
20 (C):
21 (C):
22 (C):
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -25,4 +25,23 @@ expression: "format!(\"{:?}\", grid)"
19 (C): This is 132 column mode, dark background.Push <RETURN>
20 (C):
21 (C):
22 (C):
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -25,4 +25,23 @@ expression: "format!(\"{:?}\", grid)"
19 (C): This is 80 column mode, dark background.Push <RETURN>
20 (C):
21 (C):
22 (C):
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -25,4 +25,23 @@ expression: "format!(\"{:?}\", grid)"
19 (C):
20 (C):
21 (C):
22 (C):
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -27,4 +27,21 @@ expression: "format!(\"{:?}\", grid)"
21 (W): Soft scroll down region [1..24] size 24 Line 9
22 (W): Soft scroll down region [1..24] size 24 Line 8
23 (W): Soft scroll down region [1..24] size 24 Line 7
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -3,28 +3,45 @@ source: src/client/panes/./unit/grid_tests.rs
expression: "format!(\"{:?}\", grid)"
---
00 (W):
01 (W):
02 (W):
03 (W):
04 (W):
05 (W):
06 (W):
07 (W):
08 (W):
09 (W):
10 (W):
00 (C):
01 (C):
02 (C):
03 (C):
04 (C):
05 (C):
06 (C):
07 (C):
08 (C):
09 (C):
10 (C):
11 (W): Push <RETURN>
12 (W): Jump scroll down region [12..13] size 2 Line 29
13 (W):
14 (W):
15 (W):
16 (W):
17 (W):
18 (W):
19 (W):
20 (W):
21 (W):
22 (W):
23 (W):
13 (C):
14 (C):
15 (C):
16 (C):
17 (C):
18 (C):
19 (C):
20 (C):
21 (C):
22 (C):
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -27,4 +27,21 @@ expression: "format!(\"{:?}\", grid)"
21 (W): Jump scroll down region [1..24] size 24 Line 9
22 (W): Jump scroll down region [1..24] size 24 Line 8
23 (W): Jump scroll down region [1..24] size 24 Line 7
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -27,4 +27,21 @@ expression: "format!(\"{:?}\", grid)"
21 (C): `abcdefghijklmnopqrstuvwxyz{|}~ `abcdefghijklmnopqrstuvwxyz{|}~
22 (C):
23 (C): These are the installed character sets. Push <RETURN>
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):

View File

@ -27,4 +27,31 @@ expression: "format!(\"{:?}\", grid)"
21 (C):
22 (C):
23 (C): XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):
41 (C):
42 (C):
43 (C):
44 (C):
45 (C):
46 (C):
47 (C):
48 (C):
49 (C):
50 (C):

View File

@ -27,4 +27,31 @@ expression: "format!(\"{:?}\", grid)"
21 (C):
22 (C):
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):
41 (C):
42 (C):
43 (C):
44 (C):
45 (C):
46 (C):
47 (C):
48 (C):
49 (C):
50 (C):

View File

@ -27,4 +27,31 @@ expression: "format!(\"{:?}\", grid)"
21 (C):
22 (C):
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):
41 (C):
42 (C):
43 (C):
44 (C):
45 (C):
46 (C):
47 (C):
48 (C):
49 (C):
50 (C):

View File

@ -27,4 +27,31 @@ expression: "format!(\"{:?}\", grid)"
21 (C): VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
22 (C): WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
23 (C): XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):
41 (C):
42 (C):
43 (C):
44 (C):
45 (C):
46 (C):
47 (C):
48 (C):
49 (C):
50 (C):

View File

@ -27,4 +27,31 @@ expression: "format!(\"{:?}\", grid)"
21 (C): VVVVVVVVVVVVVVVVVV
22 (C): WWWWWWWWWWWWWWWWW
23 (C): XXXXXXXXXXXXXXXX
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):
41 (C):
42 (C):
43 (C):
44 (C):
45 (C):
46 (C):
47 (C):
48 (C):
49 (C):
50 (C):

View File

@ -27,4 +27,31 @@ expression: "format!(\"{:?}\", grid)"
21 (C):
22 (C):
23 (C):
24 (C):
25 (C):
26 (C):
27 (C):
28 (C):
29 (C):
30 (C):
31 (C):
32 (C):
33 (C):
34 (C):
35 (C):
36 (C):
37 (C):
38 (C):
39 (C):
40 (C):
41 (C):
42 (C):
43 (C):
44 (C):
45 (C):
46 (C):
47 (C):
48 (C):
49 (C):
50 (C):