ANSI conversion is incomplete #48

Open
opened 2020-12-29 05:10:57 +00:00 by makeworld-the-better-one · 6 comments
makeworld-the-better-one commented 2020-12-29 05:10:57 +00:00 (Migrated from gitlab.com)

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 2020-12-29 05:13:48 +00:00 (Migrated from gitlab.com)

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 2021-02-21 02:25:15 +00:00 (Migrated from gitlab.com)

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 2021-02-21 04:34:54 +00:00 (Migrated from gitlab.com)

@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 2021-02-21 10:16:57 +00:00 (Migrated from gitlab.com)

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 2021-05-18 15:56:25 +00:00
tslocum referenced this issue from a commit 2021-05-26 20:08:16 +00:00

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 2021-05-26 20:11:13 +00:00

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
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: tslocum/cview#48
No description provided.