Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix Makefile echo escape codes (by removing them). #418

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

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

KerfuffleV2
Copy link
Collaborator

Trivial change to fix output from the Makefile when printing the line about running with -h for help. To properly output the vt100/ANSI escape codes, it needs to be echo -e not just echo which will output the string like:

\x1b[36mrun ./main -h for help\x1b[0m

The echo line also can use single quotes because variable interpolation isn't required here.

@gjmulder gjmulder added documentation Improvements or additions to documentation build Compilation issues labels Mar 23, 2023
@sw
Copy link
Contributor

sw commented Mar 23, 2023

The colors used to work on macOS and were broken on Linux, now it's the reverse (see CI checks).

@KerfuffleV2
Copy link
Collaborator Author

KerfuffleV2 commented Mar 23, 2023

@sw

I don't have access to a Mac. Can you please try these for me?

echo -e '\033[36mrun ./main -h for help\033[0m'

printf '\033[36mrun ./main -h for help\033[0m\n'

I can confirm both of those options are fine on Linux.

@sw
Copy link
Contributor

sw commented Mar 23, 2023

Me neither, but I don't think using octal instead of hex is going to do the trick. If no one else can check this on macOS, you may push the printf variant which looks fine to me, then we can run the CI again.

@KerfuffleV2
Copy link
Collaborator Author

KerfuffleV2 commented Mar 23, 2023

@sw An alternative approach would be to special case it and have different behavior based on whether or not it was running on Mac.

Personally, I don't love the idea of my Makefiles spitting out escape codes in the first place so I'd also have no problem with ripping out that part and just making it a normal line of text. There are other ways to make it stand out like with blank lines.

==== run ./main -h for help ====

Or something along those lines. That approach also works better for people with stuff like colorblindness. What do you think?

edit: I just went with that approach.

@KerfuffleV2 KerfuffleV2 force-pushed the fix-makefile-output branch from 1e54f30 to f58154a Compare March 23, 2023 11:17
@KerfuffleV2 KerfuffleV2 changed the title Fix Makefile echo escape codes. Fix Makefile echo escape codes (by removing them). Mar 23, 2023
@sw sw merged commit a140219 into ggml-org:master Mar 23, 2023
@KerfuffleV2 KerfuffleV2 deleted the fix-makefile-output branch May 28, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Compilation issues documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants