We have a library, libtoaru_termemu, that provides some basic escape sequence parsing. At one point, it was used in the kernel, but these days it is only used in our two terminal emulator frontends: terminal and terminal-vga (the header is also included in two other apps since it exposes... the default opacity of the background?
termemu is very limited. It only provides parsing. It is also heavily callback-driven, but the callbacks don't carry a context with them, so they can only feasibly be used from a single terminal. Both terminal and terminal-vga implement the rest of the terminal - cell management, drawing, key conversion, and even handling of most special characters outside of escape sequences. This results in a lot of duplication of code between the two, and, worse, missing functionality in terminal-vga.
Since we no longer use termemu in the kernel, this design limitation isn't necessary. Applications should only need to deal with getting input to the terminal "widget", and ensuring it can be rendered out somehow.
termemu should have everything needed to manage a terminal besides actually drawing it to a screen.
- A new library,
termemu-gfx should provide a wrapper around this new termemu that can manage rendering to a gfx_context_t.
terminal should do very little beyond providing menus and routing input to the above library.
terminal-vga should use termemu directly and be able to render out state to the VGA text mode buffer.
termemu should be more strictly built around supporting multiple terminal instances.
We have a library,
libtoaru_termemu, that provides some basic escape sequence parsing. At one point, it was used in the kernel, but these days it is only used in our two terminal emulator frontends:terminalandterminal-vga(the header is also included in two other apps since it exposes... the default opacity of the background?termemuis very limited. It only provides parsing. It is also heavily callback-driven, but the callbacks don't carry a context with them, so they can only feasibly be used from a single terminal. Bothterminalandterminal-vgaimplement the rest of the terminal - cell management, drawing, key conversion, and even handling of most special characters outside of escape sequences. This results in a lot of duplication of code between the two, and, worse, missing functionality interminal-vga.Since we no longer use
termemuin the kernel, this design limitation isn't necessary. Applications should only need to deal with getting input to the terminal "widget", and ensuring it can be rendered out somehow.termemushould have everything needed to manage a terminal besides actually drawing it to a screen.termemu-gfxshould provide a wrapper around this newtermemuthat can manage rendering to agfx_context_t.terminalshould do very little beyond providing menus and routing input to the above library.terminal-vgashould usetermemudirectly and be able to render out state to the VGA text mode buffer.termemushould be more strictly built around supporting multiple terminal instances.