From 4b49b1d0cc23f909d1be89cf8f816f820b343e0a Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sun, 26 Dec 2021 13:53:22 -0500 Subject: Don’t hard-code escape sequences MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of hard-coding VT100-compatible escape sequences, parse the system terminfo database and read escape sequences from it. This is both more flexible (it should work well on more terminals) and more efficient (it won’t insert padding on terminals that don’t need it). --- src/ui/terminal/line.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ui/terminal/line.h') diff --git a/src/ui/terminal/line.h b/src/ui/terminal/line.h index a90e2b7..dfe86cb 100644 --- a/src/ui/terminal/line.h +++ b/src/ui/terminal/line.h @@ -19,8 +19,10 @@ #include +#include #include +#include "goldfishterm/simple.h" #include "third_party/abseil/absl/base/thread_annotations.h" #include "third_party/abseil/absl/strings/string_view.h" #include "third_party/abseil/absl/synchronization/mutex.h" @@ -81,6 +83,7 @@ class TerminalLine final { void WriteRaw(absl::string_view bytes) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_); termios original_termios_, current_termios_; + std::unique_ptr tty_; std::thread sigwinch_watcher_; -- cgit v1.2.3