mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-25 14:05:41 -05:00
Preserve last column with erase in line right
When the erase in line escape sequence with a parameter of 0 (right) is passed while the wrapline flag is already set, it will no longer clear the last column and instead ignore the operation. The behavior of `\e[1K` and `\e[2K` is unchanged and both will clear the entire first line without clearing the wrapline flag. Closes #6159.
This commit is contained in:
parent
bcd6d0d981
commit
5a3280e8e0
7 changed files with 14 additions and 0 deletions
|
@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
- `font.glyph_offset.y` is now applied to underline/strikeout
|
- `font.glyph_offset.y` is now applied to underline/strikeout
|
||||||
- Always use sRGB color space on macOS
|
- Always use sRGB color space on macOS
|
||||||
|
- Erase in line after the last column will no longer clear the last column
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|
|
@ -1458,6 +1458,7 @@ impl<T: EventListener> Handler for Term<T> {
|
||||||
let point = cursor.point;
|
let point = cursor.point;
|
||||||
|
|
||||||
let (left, right) = match mode {
|
let (left, right) = match mode {
|
||||||
|
ansi::LineClearMode::Right if cursor.input_needs_wrap => return,
|
||||||
ansi::LineClearMode::Right => (point.column, Column(self.columns())),
|
ansi::LineClearMode::Right => (point.column, Column(self.columns())),
|
||||||
ansi::LineClearMode::Left => (Column(0), point.column + 1),
|
ansi::LineClearMode::Left => (Column(0), point.column + 1),
|
||||||
ansi::LineClearMode::All => (Column(0), Column(self.columns())),
|
ansi::LineClearMode::All => (Column(0), Column(self.columns())),
|
||||||
|
|
|
@ -70,6 +70,7 @@ ref_tests! {
|
||||||
wrapline_alt_toggle
|
wrapline_alt_toggle
|
||||||
zerowidth
|
zerowidth
|
||||||
zsh_tab_completion
|
zsh_tab_completion
|
||||||
|
erase_in_line
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_u8<P>(path: P) -> Vec<u8>
|
fn read_u8<P>(path: P) -> Vec<u8>
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
[?2004h[undeadleech@archhq erase_in_line]$ [7ms=$(echo {1..100}); echo ${s:0:$(($COLUMNS-2))}a$'+\e[0Kb'[27m
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cs=$(echo {1..100}); echo ${s:0:$(($COLUMNS-2))}a$'+\e[0Kb'
|
||||||
|
[?2004l
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49a+[0Kb
|
||||||
|
[?2004h[undeadleech@archhq erase_in_line]$ [7ms=$(echo {1..100}); echo ${s:0:$(($COLUMNS-2))}a$'+\e[1Kb'[27m
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cs=$(echo {1..100}); echo ${s:0:$(($COLUMNS-2))}a$'+\e[1Kb'
|
||||||
|
[?2004l
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49a+[1Kb
|
||||||
|
[?2004h[undeadleech@archhq erase_in_line]$ [7ms=$(echo {1..100}); echo ${s:0:$(($COLUMNS-2))}a$'+\e[2Kb'[27m
[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[C[Cs=$(echo {1..100}); echo ${s:0:$(($COLUMNS-2))}a$'+\e[2Kb'
|
||||||
|
[?2004l
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49a+[2Kb
|
||||||
|
[?2004h[undeadleech@archhq erase_in_line]$ [?2004l
|
||||||
|
exit
|
1
alacritty_terminal/tests/ref/erase_in_line/config.json
Normal file
1
alacritty_terminal/tests/ref/erase_in_line/config.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"history_size":0}
|
1
alacritty_terminal/tests/ref/erase_in_line/grid.json
Normal file
1
alacritty_terminal/tests/ref/erase_in_line/grid.json
Normal file
File diff suppressed because one or more lines are too long
1
alacritty_terminal/tests/ref/erase_in_line/size.json
Normal file
1
alacritty_terminal/tests/ref/erase_in_line/size.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"columns":139,"screen_lines":33}
|
Loading…
Reference in a new issue