diff options
Diffstat (limited to 'alacritty_terminal')
-rw-r--r-- | alacritty_terminal/src/ansi.rs | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 619b1d39..8240ff00 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -812,10 +812,6 @@ where unhandled(params); }, - // Set icon name. - // This is ignored, since alacritty has no concept of tabs. - b"1" => (), - // Set color index. b"4" => { if params.len() > 1 && params.len() % 2 != 0 { @@ -970,6 +966,9 @@ where ('A', None) => { handler.move_up(Line(arg_or_default!(idx: 0, default: 1) as usize)); }, + ('B', None) | ('e', None) => { + handler.move_down(Line(arg_or_default!(idx: 0, default: 1) as usize)) + }, ('b', None) => { if let Some(c) = self.state.preceding_char { for _ in 0..arg_or_default!(idx: 0, default: 1) { @@ -979,24 +978,27 @@ where debug!("tried to repeat with no preceding char"); } }, - ('B', None) | ('e', None) => { - handler.move_down(Line(arg_or_default!(idx: 0, default: 1) as usize)) + ('C', None) | ('a', None) => { + handler.move_forward(Column(arg_or_default!(idx: 0, default: 1) as usize)) }, ('c', None) if arg_or_default!(idx: 0, default: 0) == 0 => { handler.identify_terminal(writer) }, - ('C', None) | ('a', None) => { - handler.move_forward(Column(arg_or_default!(idx: 0, default: 1) as usize)) - }, ('D', None) => { handler.move_backward(Column(arg_or_default!(idx: 0, default: 1) as usize)) }, + ('d', None) => { + handler.goto_line(Line(arg_or_default!(idx: 0, default: 1) as usize - 1)) + }, ('E', None) => { handler.move_down_and_cr(Line(arg_or_default!(idx: 0, default: 1) as usize)) }, ('F', None) => { handler.move_up_and_cr(Line(arg_or_default!(idx: 0, default: 1) as usize)) }, + ('G', None) | ('`', None) => { + handler.goto_col(Column(arg_or_default!(idx: 0, default: 1) as usize - 1)) + }, ('g', None) => { let mode = match arg_or_default!(idx: 0, default: 0) { 0 => TabulationClearMode::Current, @@ -1009,14 +1011,19 @@ where handler.clear_tabs(mode); }, - ('G', None) | ('`', None) => { - handler.goto_col(Column(arg_or_default!(idx: 0, default: 1) as usize - 1)) - }, ('H', None) | ('f', None) => { let y = arg_or_default!(idx: 0, default: 1) as usize; let x = arg_or_default!(idx: 1, default: 1) as usize; handler.goto(Line(y - 1), Column(x - 1)); }, + ('h', intermediate) => { + for arg in args { + match Mode::from_primitive(intermediate, *arg) { + Some(mode) => handler.set_mode(mode), + None => unhandled!(), + } + } + }, ('I', None) => handler.move_forward_tabs(arg_or_default!(idx: 0, default: 1)), ('J', None) => { let mode = match arg_or_default!(idx: 0, default: 0) { @@ -1045,13 +1052,6 @@ where handler.clear_line(mode); }, - ('S', None) => handler.scroll_up(Line(arg_or_default!(idx: 0, default: 1) as usize)), - ('t', None) => match arg_or_default!(idx: 0, default: 1) as usize { - 22 => handler.push_title(), - 23 => handler.pop_title(), - _ => unhandled!(), - }, - ('T', None) => handler.scroll_down(Line(arg_or_default!(idx: 0, default: 1) as usize)), ('L', None) => { handler.insert_blank_lines(Line(arg_or_default!(idx: 0, default: 1) as usize)) }, @@ -1064,24 +1064,6 @@ where } }, ('M', None) => handler.delete_lines(Line(arg_or_default!(idx: 0, default: 1) as usize)), - ('X', None) => { - handler.erase_chars(Column(arg_or_default!(idx: 0, default: 1) as usize)) - }, - ('P', None) => { - handler.delete_chars(Column(arg_or_default!(idx: 0, default: 1) as usize)) - }, - ('Z', None) => handler.move_backward_tabs(arg_or_default!(idx: 0, default: 1)), - ('d', None) => { - handler.goto_line(Line(arg_or_default!(idx: 0, default: 1) as usize - 1)) - }, - ('h', intermediate) => { - for arg in args { - match Mode::from_primitive(intermediate, *arg) { - Some(mode) => handler.set_mode(mode), - None => unhandled!(), - } - } - }, ('m', None) => { if args.is_empty() { handler.terminal_attribute(Attr::Reset); @@ -1097,6 +1079,9 @@ where ('n', None) => { handler.device_status(writer, arg_or_default!(idx: 0, default: 0) as usize) }, + ('P', None) => { + handler.delete_chars(Column(arg_or_default!(idx: 0, default: 1) as usize)) + }, ('q', Some(b' ')) => { // DECSCUSR (CSI Ps SP q) -- Set Cursor Style. let style = match arg_or_default!(idx: 0, default: 0) { @@ -1118,8 +1103,19 @@ where handler.set_scrolling_region(top, bottom); }, + ('S', None) => handler.scroll_up(Line(arg_or_default!(idx: 0, default: 1) as usize)), ('s', None) => handler.save_cursor_position(), + ('T', None) => handler.scroll_down(Line(arg_or_default!(idx: 0, default: 1) as usize)), + ('t', None) => match arg_or_default!(idx: 0, default: 1) as usize { + 22 => handler.push_title(), + 23 => handler.pop_title(), + _ => unhandled!(), + }, ('u', None) => handler.restore_cursor_position(), + ('X', None) => { + handler.erase_chars(Column(arg_or_default!(idx: 0, default: 1) as usize)) + }, + ('Z', None) => handler.move_backward_tabs(arg_or_default!(idx: 0, default: 1)), _ => unhandled!(), } } |