Skip to content
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

Colorize terminal output, if possible #2608

Merged
merged 1 commit into from
Aug 7, 2021

Conversation

carstene1ns
Copy link
Member

@carstene1ns carstene1ns commented Jul 31, 2021

Also, allow the browser to filter/colorize the console log.

Needs testing on:

  • Windows (debug build opens console)
  • Web
  • Linux
  • Wii (usbgecko, may be emulated by dolphin)
  • 3DS (debug build or with 3dslink)
  • Switch (nxlink)

Obligatory screenshot:
20210731-190218

@carstene1ns carstene1ns added the UX For issues affecting the user experience, such annoyances, counter-intuitive or ugly design label Jul 31, 2021
@carstene1ns carstene1ns added this to the 0.7.0 milestone Jul 31, 2021
@Ghabry
Copy link
Member

Ghabry commented Jul 31, 2021

Btw fmtlib also supports colours but it lacks all the Pty etc detection and only uses ansi escape codes

Copy link
Contributor

@fdelapena fdelapena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, thanks!

The emscripten console log levels worked, too: https://easyrpg.org/play/pr2608/

- Enable only when running from a terminal
- Command line option to disable
@carstene1ns
Copy link
Member Author

After further thinking about it, it does not make sense to have this on non-desktop platforms, so these just get the current behaviour.

@fdelapena
Copy link
Contributor

Captura de pantalla de 2021-08-03 12-57-35

It works as expected on Windows.

@carstene1ns
Copy link
Member Author

Thank you, I guess this is ready then 👍

for (int i = 1; i < argc; ++i) {
if (strcmp(argv[i], "--no-log-color") == 0) {
Output::SetTermColor(false);
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is really a general problem that should be addressed in a further PR.

This is also a problem for --help and --version: Before printing there stuff the console already contains "EasyRPG" and "CLI".

Copy link
Member

@Ghabry Ghabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Fedora will just be unhappy because we vendor too much stuff ;)

@Ghabry Ghabry merged commit 77fee9c into EasyRPG:master Aug 7, 2021
@carstene1ns carstene1ns deleted the feature/terminal-colors branch August 7, 2021 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UX For issues affecting the user experience, such annoyances, counter-intuitive or ugly design
Development

Successfully merging this pull request may close these issues.

None yet

3 participants