-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve action log display with control chars #23820
Conversation
3ebe3e6
to
edde647
Compare
edde647
to
3799a92
Compare
Would this have adverse effects of Windows-style newlines |
Nope, you can check the tests, one of them covers the ending "\r".
|
To make code more strict, I make the function remove the trailing "\r\n" or "\n" in 2c72257 , then it doesn't matter whether the line ends with new-line or not. |
Codecov Report
@@ Coverage Diff @@
## main #23820 +/- ##
==========================================
- Coverage 47.14% 46.98% -0.16%
==========================================
Files 1149 1158 +9
Lines 151446 153175 +1729
==========================================
+ Hits 71397 71971 +574
- Misses 71611 72706 +1095
- Partials 8438 8498 +60
... and 67 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
image: docker:23 I prefer add a special process to handle
|
I see, I haven't spent enough time on this problem and it looks like not that simple. The comment So let's mark this PR as WIP. To make a further improvement, I guess there could be 3 approaches:
Feel free to help or propose new PRs (while I am trying to implement approach 2) |
@yp05327 what do you think about approach 2: "Make frontend split" ? I think it's clear and simple enough, and the output is still reasonable: because these strings are indeed rendered in one line if you run the command in terminal. See 9d35890 and its tests. If we want to implement approach 1, I am not sure how much work it needs for backend changes (if approach 2 is good enough, then we do not need to change backend's behavior). If we want to implement approach 3, we need make AnsiToHTML package support Erase Control Chars , or choose other rendering packages. |
01dcd0b
to
400cb2e
Compare
…ng...5%\nReading...100%"
400cb2e
to
9d35890
Compare
I agree approach 2 and 3. And using an existing package to handle it looks better, as we don’t need to maintain it by ourselves to support all possible chars and cases. |
Thank you. I think 9d35890 could implement approach 2. If it looks good to you, let's move on ~~ I have done a quick test, the "\n" looks good to me 😁 |
I found the original log files, and it seems that the reason of this problem is |
There is a document maybe related? |
Remove them or convert them into HTML code? I found some solutions maybe related.
|
That's also the comment in code |
Hmm, I think it's a bug in Without our code,
|
fd6aa9a
to
aaa2a5e
Compare
Although it's related to upstream bug/limitation (https://github.com/rburns/ansi-to-html) , upstream has many open issues/PRs, so I guess we could bypass the bug on our side first. And I guess some behaviors we like couldn't be accepted by upstream easily (eg: treat the So, let's try to use 2604c22 to patch. |
aaa2a5e
to
2604c22
Compare
Maybe there better JS modules around for this. Many parts of GitHub's JS are open source, so I wonder if they may have their terminal rendering also available somewhere 😉. |
|
I think it's much better than before. Do you prefer to see full progress list or the only one final line?
|
3b2e315
to
15dbf40
Compare
* upstream/main: [skip ci] Updated translations via Crowdin Update JS deps (go-gitea#23853) Added close/open button to details page of milestone (go-gitea#23877) Check `IsActionsToken` for LFS authentication (go-gitea#23841) Prefill input values in oauth settings as intended (go-gitea#23829) Display image size for multiarch container images (go-gitea#23821) Use clippie module to copy to clipboard (go-gitea#23801) Remove assertion debug code for show/hide refactoring (go-gitea#23576) [skip ci] Updated translations via Crowdin Remove jQuery ready usage (go-gitea#23858) Fix JS error when changing PR's target branch (go-gitea#23862) Improve action log display with control chars (go-gitea#23820) Fix review conversation reply (go-gitea#23846) Improve home page template, fix Sort dropdown menu flash (go-gitea#23856) Make first section on home page full width (go-gitea#23854) [skip ci] Updated translations via Crowdin Fix incorrect CORS failure detection logic (go-gitea#23844)
Close #23680
Some CLI programs use "\r" and control chars to print new content in current line.
So, the strings in one line are actually from
\rReading...1%\rReading...5%\rReading...100%
This PR tries to make the output better.