Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • L liner
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 8
    • Issues 8
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • redox-os
  • liner
  • Issues
  • #13
Closed
Open
Created Jul 17, 2020 by Aaron Janse@aaronjanse

Rendering optimization

Currently, liner (the readline library used by ion) rewrites the entire line when a character is typed. At least on my machine, this makes using ion in qemu very painful and slow.

I'd like to change this. I have experience with terminal rendering from building 3mux.

To do this, I think we'd maintain state of the current terminal line. We'd need some sort of struct keeping track of colors and attributes (e.g. bold, dim).

I think the biggest difficulty would be the way that highlighting is done. Currently, the highlighter returns a string with ecma48 syntax (e.g. Hello \e[91mdodo\e[m world). Parsing ecma48 is a lot of work. Possible solutions:

  • Have syntax highlighters directly modify a copy of the line state. For example, we could have a helper function to bold characters from index X to Y in the line (best option imo)
  • Write some easier-to-parse-than-ecma48 syntax, possibly borrowing prompt code from ion (okay-ish option imo)
  • Just build an ecma48 parser (worst option imo) Use https://gitlab.redox-os.org/redox-os/ransid for parsing ecma48

I understand this would break redox_liner API compatibility. But as far as I can tell, only ion depends on redox_liner. Because ion doesn't currently do syntax highlighting, we could change the syntax highlighting API here without breaking ion.

Cheers!

Edited Jul 17, 2020 by Aaron Janse
Assignee
Assign to
Time tracking