Skip to content

Re-write input parsing, to work more like how ncurses handles data. #3

@Gabidal

Description

@Gabidal

Problem / Motivation

without ncurses or terminfo and all of the data they have we have to resort using some "random" looking sequence of characters, which basically all TUI projects unfortunately have. For maintainability and more complex sequence capabilities, we need proper implementation of the base stated here: ecma-48

Proposed solution(s)

  • Implement basic data re-contrsuct of the ecma-48 tables and their sequence parsing tools
  • Transport all input handling from renderer.cpp into the new core subfolder: terminal.
  • New terminal namespace and it's functionalities to maintain terminals as device objects, capable of holding statuses, such as:
    • mouse
    • keyboard
    • etc...
  • Add private functions for DEC terminals, which majority of terminal emulators implement, such as:
    • xterm
    • alacritty
    • etc...
  • Add proper platform prober, which would be capable of deducing what capabilities the current I/O GGUI is running in, has. This way if GGUI is routed into a file instead of a TTY stream, no coloring would be applied. And for more or less advanced terminals, GGUI should be able to use the correct color palette or whatever ecma-48 allows us to do.
    • For an example not all TTY terminals support extended SGR mouse movements.

Alternatives considered

I Want usability and most amount of compile-time code deduction.
Parsing sequences from strings, is hard, since CSI can be any arbitrary length.
Constructing sequences from code into string in contrary should be possible even at compile time, if we use superString and compactStrings, although this is to be seen if possible.

Example / Prototype (optional)

No response

Impact / Priority (optional)

High

Related PR or Issue (optional)

Additional context

progress for this PR is done in this branch

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions