CSI dispatch
(&mut self, params: &Params, _: &[u8], _: bool, c: char)
| 463 | { |
| 464 | // CSI dispatch |
| 465 | fn csi_dispatch(&mut self, params: &Params, _: &[u8], _: bool, c: char) |
| 466 | { |
| 467 | match c |
| 468 | { |
| 469 | 'm' => |
| 470 | { |
| 471 | // Foreground |
| 472 | let mut fg = FOREGROUND; |
| 473 | |
| 474 | // Background |
| 475 | let mut bg = BACKGROUND; |
| 476 | |
| 477 | for param in params.iter() |
| 478 | { |
| 479 | match param[0] |
| 480 | { |
| 481 | 0 => |
| 482 | { |
| 483 | fg = FOREGROUND; |
| 484 | bg = BACKGROUND; |
| 485 | }, |
| 486 | |
| 487 | 30..=37 | 90..=97 => |
| 488 | { |
| 489 | fg = std_color::fromansi(param[0] as u8); |
| 490 | }, |
| 491 | |
| 492 | 40..=47 | 100..=107 => |
| 493 | { |
| 494 | bg = std_color::fromansi((param[0] as u8) - 10); |
| 495 | }, |
| 496 | |
| 497 | _ => {}, |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | self.color_set(fg, bg); |
| 502 | }, |
| 503 | |
| 504 | // Cursor up |
| 505 | 'A' => |
| 506 | { |
| 507 | let mut n = 1; |
| 508 | for param in params.iter() |
| 509 | { |
| 510 | n = param[0] as usize; |
| 511 | } |
| 512 | |
| 513 | self.writer[1] -= n; |
| 514 | self.cur[1] -= n; |
| 515 | }, |
| 516 | |
| 517 | // Cursor down |
| 518 | 'B' => |
| 519 | { |
| 520 | let mut n = 1; |
| 521 | for param in params.iter() |
| 522 | { |
nothing calls this directly
no test coverage detected