Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,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();
Expand Down
2 changes: 1 addition & 1 deletion src/client/panes/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Original file line number Diff line number Diff line change
Expand Up @@ -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):

Original file line number Diff line number Diff line change
Expand Up @@ -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):

Loading