Please stop marking this question as a duplicate, it's not a duplicate. Thanks. Consider the sequence of a
, followed by \x1b[D
("cursor back"), followed by b
. This would produce an output of just b
.
I am looking to experiment with and create TUI applications (examples: less, vim), e.g. using ncurses style libraries or with raw application of escape sequences.
I've found that as a tmux user, tmux offers a very useful capture-pane
feature which could be a good basis for a test framework that can use this as a form of "screenshot" functionality for test verification purposes. For example, rather than manually testing the output for correctness and, say, establishing a test that runs the program under test for a specific window size and then comparing the output with a rigid string compare, I could instead run it under tmux through a wide range of window dimensions and check the rendered state to satisfy requirements in a practical way.
Anyway, the point is that this seems to be the only way I know of to "resolve" a terminal byte stream into a terminal screen buffer. As great and versatile as tmux is, I'm somewhat hoping for a tool that provides this specific capability. Since I read some more today about what ptys are and how they work here, it does seem to me that this aspect of the system is in the purview of the terminal emulator, and something like tmux is rather unique in that it has to do it while not being a GUI application (which is a plus here).
tee
away). – Steven Lu Nov 14 '20 at 04:15