周玉环 d906a41c2e first commit 2 hari lalu
..
winterm d906a41c2e first commit 2 hari lalu
LICENSE d906a41c2e first commit 2 hari lalu
README.md d906a41c2e first commit 2 hari lalu
SECURITY.md d906a41c2e first commit 2 hari lalu
constants.go d906a41c2e first commit 2 hari lalu
context.go d906a41c2e first commit 2 hari lalu
csi_entry_state.go d906a41c2e first commit 2 hari lalu
csi_param_state.go d906a41c2e first commit 2 hari lalu
escape_intermediate_state.go d906a41c2e first commit 2 hari lalu
escape_state.go d906a41c2e first commit 2 hari lalu
event_handler.go d906a41c2e first commit 2 hari lalu
ground_state.go d906a41c2e first commit 2 hari lalu
osc_string_state.go d906a41c2e first commit 2 hari lalu
parser.go d906a41c2e first commit 2 hari lalu
parser_action_helpers.go d906a41c2e first commit 2 hari lalu
parser_actions.go d906a41c2e first commit 2 hari lalu
states.go d906a41c2e first commit 2 hari lalu
utilities.go d906a41c2e first commit 2 hari lalu

README.md

go-ansiterm

This is a cross platform Ansi Terminal Emulation library. It reads a stream of Ansi characters and produces the appropriate function calls. The results of the function calls are platform dependent.

For example the parser might receive "ESC, [, A" as a stream of three characters. This is the code for Cursor Up (http://www.vt100.net/docs/vt510-rm/CUU). The parser then calls the cursor up function (CUU()) on an event handler. The event handler determines what platform specific work must be done to cause the cursor to move up one position.

The parser (parser.go) is a partial implementation of this state machine (http://vt100.net/emu/vt500_parser.png). There are also two event handler implementations, one for tests (test_event_handler.go) to validate that the expected events are being produced and called, the other is a Windows implementation (winterm/win_event_handler.go).

See parser_test.go for examples exercising the state machine and generating appropriate function calls.


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.