ANSI conversion is incomplete #48

Open
opened 2 years ago by makeworld-the-better-one · 6 comments
makeworld-the-better-one commented 2 years ago (Migrated from gitlab.com)
Owner

Try test.ans for example, and compare doing cat test.ans | less -r with it, versus using cview.TranslateANSI in a TextView. The colors are much darker, and more importantly, some of the blocks just seem incorrect? For example, compare the face half the way down.

Use cat test.ans | less -r

Screenshot_2020-12-29_00-07-18

Using cview:

Screenshot_2020-12-29_00-07-05

Now I believe the color difference is just my terminal, but the glitching is an issue.

To try this out easily, you can use the code sample you gave me here, but just cat the ANSI file instead.

Try [test.ans](/uploads/b30cca50b696a378b37a7982c2478078/test.ans) for example, and compare doing `cat test.ans | less -r` with it, versus using `cview.TranslateANSI` in a `TextView`. The colors are much darker, and more importantly, some of the blocks just seem incorrect? For example, compare the face half the way down. Use `cat test.ans | less -r` ![Screenshot_2020-12-29_00-07-18](/uploads/11335f759b888b73e71fd2690224dcc6/Screenshot_2020-12-29_00-07-18.png) Using cview: ![Screenshot_2020-12-29_00-07-05](/uploads/9e980539ec800bf6666fadf09e6d9706/Screenshot_2020-12-29_00-07-05.png) Now I believe the color difference is just my terminal, but the glitching is an issue. To try this out easily, you can use the code sample you gave me [here](https://gitlab.com/tslocum/cview/-/issues/25#note_430648101), but just `cat` the ANSI file instead.
makeworld-the-better-one commented 2 years ago (Migrated from gitlab.com)
Owner

Also there appears to be some actual color issues (not just brighter) if you compare the beginning of the file.

Also there appears to be some actual color issues (not just brighter) if you compare the beginning of the file.
L00M commented 1 year ago (Migrated from gitlab.com)
Owner

i had the same issue. maybe it's a bug in the util overlayStyle. It's using the defaultStyle for mixing but the defaultStyle in the TextView is missing a backgorund color, so backgorund resets fail for my terminal (st). for a quick fix i have changed this line in textview.go from

defaultStyle := tcell.StyleDefault.Foreground(t.textColor)

to

defaultStyle := tcell.StyleDefault.Foreground(t.textColor).Background(tcell.ColorBlack)

and later added a dedicated backgroundColor to the textview struct, like textColor

i had the same issue. maybe it's a bug in the util overlayStyle. It's using the defaultStyle for mixing but the defaultStyle in the TextView is missing a backgorund color, so backgorund resets fail for my terminal (st). for a quick fix i have changed this line in textview.go from ``` defaultStyle := tcell.StyleDefault.Foreground(t.textColor) ``` to ``` defaultStyle := tcell.StyleDefault.Foreground(t.textColor).Background(tcell.ColorBlack) ``` and later added a dedicated backgroundColor to the textview struct, like textColor
makeworld-the-better-one commented 1 year ago (Migrated from gitlab.com)
Owner

@L00M Thanks for looking into this. Could you try your changes with my example test file? Because it looks to me like more than just some background reset issues, but maybe I'm wrong about that.

@L00M Thanks for looking into this. Could you try your changes with my example test file? Because it looks to me like more than just some background reset issues, but maybe I'm wrong about that.
L00M commented 1 year ago (Migrated from gitlab.com)
Owner

i don't know. The script does not work for me.

panic: inappropriate ioctl for device

goroutine 1 [running]:
main.main()
        /home/loom/test/testansi.go:27 +0x259

but i had output issues when not using a background in the default style, justmodify the textintput.go file in your GOSOurce Folder and try it by your self.

i don't know. The script does not work for me. ``` panic: inappropriate ioctl for device goroutine 1 [running]: main.main() /home/loom/test/testansi.go:27 +0x259 ``` but i had output issues when not using a background in the default style, justmodify the textintput.go file in your GOSOurce Folder and try it by your self.
tslocum added the
bug
label 1 year ago
tslocum referenced this issue from a commit 1 year ago
Owner

The colors seem to be fixed now. Let me know if you are still seeing any discrepancies there. As far as some ANSI characters not translating correctly, I would appreciate some help with this.

The colors seem to be fixed now. Let me know if you are still seeing any discrepancies there. As far as some ANSI characters not translating correctly, I would appreciate some help with this.
tslocum added the
help wanted
label 1 year ago

Ok, I can confirm that the color is fixed, thanks! I'm not sure if I can help with the translation, but if I can I'll make a PR.

Ok, I can confirm that the color is fixed, thanks! I'm not sure if I can help with the translation, but if I can I'll make a PR.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.