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

macOS no color help #76

Closed
grylem opened this issue Jun 3, 2021 · 12 comments
Closed

macOS no color help #76

grylem opened this issue Jun 3, 2021 · 12 comments
Assignees

Comments

@grylem
Copy link

grylem commented Jun 3, 2021

Hi
bfs -help
ESC[01;36m-PESC[0m etc. instead color
Regards.

@tavianator tavianator added the bug label Jun 3, 2021
@tavianator
Copy link
Owner

Thanks for the report. Did this work with the previous version (2.2)? Can you tell me the output of

echo $PAGER
echo $LESS

@grylem
Copy link
Author

grylem commented Jun 3, 2021

Did this work with the previous version (2.2)?

No. The old version has the same problems

echo $PAGER
nothing
echo $LESS
-R

@tavianator
Copy link
Owner

Ah okay. bfs doesn't override LESS because if it's explicitly set, it might have flags that are necessary to make it work right on a particular terminal or something. If you do LESS= bfs -help it should set the right flags.

This is the same behaviour as git by the way. If git log etc. have colors for you, maybe you have pager set to something in your ~/.gitconfig?

@tavianator
Copy link
Owner

Hmm actually LESS=-R should work. I'll see if I can get access to a mac to reproduce. Does LESS=FKRX bfs -help work? What about LESS=R bfs -help?

@grylem
Copy link
Author

grylem commented Jun 4, 2021

maybe you have pager set to something in your ~/.gitconfig?

no

LESS=FKRX bfs -help, LESS=R bfs -help

change shell from bash to sh, ksh(without shrc etc.), update less from macports version 581 - with the same result.

@tavianator
Copy link
Owner

Oh wait a second, what about with PAGER=less?

@grylem
Copy link
Author

grylem commented Jun 4, 2021

PAGER=less bfs -help
it works fine

@tavianator
Copy link
Owner

Ah okay. So what's going on is by default bfs actually uses more since it's a POSIX utility, whereas less might not be installed. I guess the more on macOS escapes the escape sequences, unlike on Linux. I can reproduce this on FreeBSD too, so I should be able to fix it.

@tavianator tavianator self-assigned this Jun 4, 2021
@grylem
Copy link
Author

grylem commented Jun 4, 2021

it is very good.
Also for old macOS clang(High Sierra Apple LLVM version 10.0.0 (clang-1000.11.45.5)) i have a lot of warnings like
warning: declaration does not declare anything [-Wmissing-declarations]

@tavianator
Copy link
Owner

Hmm can you paste one of the warnings in its entirety?

@grylem
Copy link
Author

grylem commented Jun 4, 2021

eval.c:241:3: warning: declaration does not declare anything [-Wmissing-declarations]
fallthrough;
^
./util.h:98:22: note: expanded from macro 'fallthrough'
# define fallthrough attribute((fallthrough))
^
eval.c:244:3: warning: declaration does not declare anything [-Wmissing-declarations]
fallthrough;
^
./util.h:98:22: note: expanded from macro 'fallthrough'
# define fallthrough attribute((fallthrough))

@tavianator
Copy link
Owner

41c148c should fix the warnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants