aboutsummaryrefslogtreecommitdiff
path: root/src/tty.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-05-28 22:09:25 -0700
committerJoe Wilm <joe@jwilm.com>2016-05-28 22:09:25 -0700
commit70b0423a31016798592fc0e96ce316cb3f1e9d46 (patch)
tree16c728435d66b9bdd7716a3a00b5deadc9c89076 /src/tty.rs
parent493a7fae7c1dccc6c45fc175c354f3ebab141a21 (diff)
downloadalacritty-70b0423a31016798592fc0e96ce316cb3f1e9d46.tar.gz
alacritty-70b0423a31016798592fc0e96ce316cb3f1e9d46.zip
Initial ANSI parser implementation
This is the initial terminal stream parsing implementation for Alacritty. There are currently several TODOs, FIXMEs, and unimplemented! things scattered about still, but what's here is good enough to correctly parse my zsh startup. The `Parser` implementation is largely based on the suck-less _simple terminal_ parser. Because this is Rust and Rust has a fantastic type system, some improvements are possible. First, `Parser` is a struct, and its data is stored internally instead of statically. Second, there's no terminal updates hard-coded into the parser. Instead, `Parser` is generic over a `Handler` type which has methods for all of the actions supported by the parser. Because Parser is generic, it should be possible (with proper inlining) to have equivalent performance to the hard-coded version. In addition to using _simple terminal_ as a reference, there's a doc in Alacritty's repository `docs/ansicode.txt`, a summary of the ANSI terminal protocol, which has been referenced extensively. There's probably a large number escapes we don't handle, and that's ok. There's a lot that aren't necessary for everyday terminal usage. If you feel like something that's not supported should be, feel free to add it. Please try not to become overzealous and adding support for sequences only used by folks trapped in 1988.
Diffstat (limited to 'src/tty.rs')
-rw-r--r--src/tty.rs7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/tty.rs b/src/tty.rs
index 7fd27b69..2f2a84b5 100644
--- a/src/tty.rs
+++ b/src/tty.rs
@@ -9,13 +9,6 @@ use std::ptr;
use libc::{self, winsize, c_int, c_char};
-macro_rules! die {
- ($($arg:tt)*) => {
- println!($($arg)*);
- ::std::process::exit(1);
- }
-}
-
pub enum Error {
/// TODO
Unknown,