[GH-ISSUE #1022] ANSI Escape Sequences #739

Open
opened 2026-03-04 01:07:25 +03:00 by kerem · 1 comment
Owner

Originally created by @mgale on GitHub (Sep 6, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/1022

Hello,

After reading the below issues with looks like the handling of ansi escape control sequences is not currently supported, can you confirm if that is the case still?

https://github.com/rivo/tview/issues/24
https://github.com/rivo/tview/issues/568
https://github.com/rivo/tview/issues/746

Do you think the following approach could work?

I have an incoming bytes stream that I was writing directly to a textview but instead I can try:

  1. Reading the bytes stream into a parser first
  2. If I detect an escape control sequence, for example clearing the screen I can execute the appropriate tview change.
  3. If I do not detect an escape control sequence write the bytes to the textview.

Thanks

Originally created by @mgale on GitHub (Sep 6, 2024). Original GitHub issue: https://github.com/rivo/tview/issues/1022 Hello, After reading the below issues with looks like the handling of ansi escape control sequences is not currently supported, can you confirm if that is the case still? https://github.com/rivo/tview/issues/24 https://github.com/rivo/tview/issues/568 https://github.com/rivo/tview/issues/746 Do you think the following approach could work? I have an incoming bytes stream that I was writing directly to a textview but instead I can try: 1. Reading the bytes stream into a parser first 2. If I detect an escape control sequence, for example clearing the screen I can execute the appropriate tview change. 3. If I do not detect an escape control sequence write the bytes to the textview. Thanks
Author
Owner

@rivo commented on GitHub (Sep 7, 2024):

can you confirm if that is the case still?

Apart from the ability to translate some common ANSI sequences into style tags, yes, this is still the case. Running an interactive application inside another application is the domain of utilities such as sceen or tmux and (currently) out of scope for tview.

instead I can try

Sure you can try that. I'm not familiar, however, with all the different ANSI sequences so I don't know if you'll be able to map them all to a TextView.

<!-- gh-comment-id:2335172284 --> @rivo commented on GitHub (Sep 7, 2024): > can you confirm if that is the case still? Apart from the ability to translate some common ANSI sequences into style tags, yes, this is still the case. Running an interactive application inside another application is the domain of utilities such as `sceen` or `tmux` and (currently) out of scope for `tview`. > instead I can try Sure you can try that. I'm not familiar, however, with all the different ANSI sequences so I don't know if you'll be able to map them all to a `TextView`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#739
No description provided.