Skip to content

Conversation

@Helodity
Copy link

@Helodity Helodity commented May 3, 2025

This adds support for the following ANSI codes

  • /033[#A: Move cursor up
  • /033[#B: Move cursor down
  • /033[#C: Move cursor right
  • /033[#D: Move cursor left
  • /033[?25l and /033[?25h: Toggle cursor visibility (This codes do not alter the output, but are now properly hidden)

This addition required an extensive rewrite of how text is formatted. Now, text is broken into chunks, and reassembled based on its target position. Formatting is tracked individually for each chunk, and is appended when inserted into the final output string.

Example (using neofetch):
Before
imagePre

After:
imagePost

With config modification (Setting space character to braille space, reducing line spacing, and changing the font):
image

TODO:

  • Bold text does not properly show
  • Handle scenarios where the cursor moves to a previously written position
  • Implement /033[?7l and /033[?7h (Enable and disable line wrapping)
  • Further test other commands
  • Modifying line spacing causes text to not respect vertical alignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant