ansi-econsole
ansi-econsole copied to clipboard
Tab-formatting failure: First tab after an ANSI code is only 1 char long instead of 8
Issue:
- A properly aligned tab which should have its maximum allowed tabwidth is only 1 char long, when its after an ANSI code. Following tabs will fix this issue.
Expected behavior:
- A tab which is properly aligned should have its maximum allowed tablwidth, no matter if its after an ANSI code.
Confirmation:
- Expected behavior can be confirmed by simply running failing code in any common linux terminal.
Testcase:
- Simple test to cause the behavior. In this case the tabwidth is 8 chars. The first tab will be 1 char long. The second tab behaves normal again and has a proper width (7 chars) to jump back into the normal tab-grid again.
System.out.println("\033[93m\t\t<");
Ansi Console Version: 1.3.5.201612301822 Eclipse:
- Version: 2019-09 R (4.13.0)
- Build id: 20190917-1200
I don't see any problem.
I've tried this:
System.out.println("\t\t<");
System.out.println("\033[93m\t\t<"); // the line from the bug report
System.out.println("\t\t<");
System.out.println("\033[m\t\t<");
System.out.println("123456789012345678901234567890");
I get this:
<
< => this one is yellow
< => this one is yellow
<
123456789012345678901234567890
The only difference is (I think) Eclipse, I am on: Version: 2018-12 (4.10.0) Build id: 20181214-0600 I will install 20190917-1200 to try it.
Other info (not sure if relevant or not): Windows 10, and Eclipse with Dark theme.
I am using dark theme. Am running Ubuntu
Darn... I can see it in Version: 2019-09 R (4.13.0) (Build id: 20190917-1200) :-(
Although I doubt there is much I can do... This is Eclipse braking things. This worked just fine since 2012, Eclipse 3.8 :-(
I'll try some more things, and then probably file a bug against Eclipse...
Thanks for investigating it, I should have tested it on my other older eclipse too.
I also looked into your code and that certainly looks like it's not at fault.
For now I am using a workaround so I am fine. I better get rid of that version of eclipse by upgrade or downgrade.