what-changed icon indicating copy to clipboard operation
what-changed copied to clipboard

Truncate too early on 80 character width terminal

Open simonschaufi opened this issue 5 years ago • 6 comments

I have a 80 character terminal in ubuntu and the commit message is truncated way too early. For comparison I added a line below to see how much space there is still available.

dantleech/what-changed: 9 updated

  laravel/framework 8299b6dc..4de12917

    [2020-03-26 16:43:40] 3c692967 ThomasTrost ...

> |----------------------------------------------------------------------------|

simonschaufi avatar Apr 23 '20 11:04 simonschaufi

hmm, I guess this is the culprit: https://github.com/dantleech/what-changed/blob/master/lib/Adapter/Symfony/Report/ConsoleReport.php

not sure why I truncate at <Terminal Width> - 30

dantleech avatar Apr 23 '20 11:04 dantleech

Looking at the class, I found a lot more bugs as lots of tags (info, comment) are not closed properly

simonschaufi avatar Apr 23 '20 14:04 simonschaufi

</>? that's valid if that's what you mean?

dantleech avatar Apr 23 '20 16:04 dantleech

I haven't seen this kind of closing tag in symfony console yet.

In lots of cases I see a line like this in the output: [2020-04-03 05:57:47] 6f19efdc sebastianbergmann</com... and as you can see, the closing tag is also truncated. That's what I mean.

simonschaufi avatar Apr 23 '20 20:04 simonschaufi

yes -- that's because we truncate the string with the formatting tags - maybe there is a good solution for this in Symfony, not sure.

dantleech avatar Apr 23 '20 22:04 dantleech

Maybe ignore the counting of additional characters while you are in a tag and then only count the characters outside. The main point of this issue is the total length. What i mentioned now is actually another bug.

simonschaufi avatar Apr 23 '20 22:04 simonschaufi