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

No color after commit 95dedab #9

Open
sebastiencs opened this issue Jun 18, 2022 · 12 comments
Open

No color after commit 95dedab #9

sebastiencs opened this issue Jun 18, 2022 · 12 comments

Comments

@sebastiencs
Copy link

Hello,

When I compile most on the commit 95dedab, there is no color.

Command env PAGER=most man ls:
image

And this is with its parent commit c9cfad5, colors are working correctly:
image

In both cases, its using the same variable environments, and TERM is set to xterm-256color
Please let me know if you need more informations

@sebastiencs sebastiencs changed the title No color after https://github.com/jedsoft/most/commit/95dedabe9c6b9ab05e61f718bec03ff2b0e8f09a No color after 95dedabe9c6b9ab05e61f718bec03ff2b0e8f09a Jun 18, 2022
@sebastiencs sebastiencs changed the title No color after 95dedabe9c6b9ab05e61f718bec03ff2b0e8f09a No color after commit 95dedabe9c6b9ab05e61f718bec03ff2b0e8f09a Jun 18, 2022
@sebastiencs sebastiencs changed the title No color after commit 95dedabe9c6b9ab05e61f718bec03ff2b0e8f09a No color after commit 95dedab Jun 18, 2022
@jedsoft
Copy link
Owner

jedsoft commented Jun 18, 2022

I am unable to reproduce this. Please provide the output of:

most --version 2>&1 | head

your terminal program and version, the values of the TERM and COLORTERM environment variables, as well as your OS, and if it is 32 or 64 bit.

Thanks,
--John

@sebastiencs
Copy link
Author

most --version 2>&1 | head

MOST version pre5.2-7 (S-Lang version pre2.3.3-75)
Usage:
most [-1Cbcdkrstvw] [+/string] [+line number] [+s] [+d] file...
 where: -1:  assume VT100 terminal. (VMS only)
        -b:  Startup in binary mode.
        -C:  disable color support
        -c:  Make searches case sensitive.
        -d:  Do not display the \ wrap marker when wrapping lines.
        -M:  Do not attempt to mmap files.
        -r:  Default to regexp search

I've tested on different terminals and OS, with the same result, no color:

  • alacritty 0.10.1
  • xfce4-terminal 1.0.4
  • GNOME Terminal 3.44.1 using VTE 0.68.0 +BIDI +GNUTLS +ICU +SYSTEMD

OS:

  • Fedora 35
  • Clearlinux 36510

The OS are 64 bits

COLORTERM=truecolor
TERM=xterm-256color

With most version pre5.2-6, colors are working correctly

@jedsoft
Copy link
Owner

jedsoft commented Jun 18, 2022 via email

@sebastiencs
Copy link
Author

Unsetting COLORTERM has no effect, there is still no color.
And it's the same result with version pre-5.2.9 (0ab81d6)

@jedsoft
Copy link
Owner

jedsoft commented Jun 19, 2022

Please try this with pre5.2.0-9:

cd /path/to/most/src
make clean && make
script
./objs/most ../testfiles/truecolor.txt
(take a screenshot and exit back to shell)
 exit

This will produce a file called `typescript'. I would appreciate it you send it and the screenshot to me.
Thanks

@sebastiencs
Copy link
Author

Alright, I tested that with pre5.2.0-9.

The screenshot, it seems that colors are correct here ?
image

And the file.
typescript.tar.gz

@sebastiencs
Copy link
Author

I've also produce another typescript file with the following commands, not sure if it helps:

cd /path/to/most/src
make clean && make
script
env PAGER=./objs/most man ls
exit

It is with that command that there is no color.

typescript_man_ls.tar.gz

@jedsoft
Copy link
Owner

jedsoft commented Jun 19, 2022

From you screenshot, your terminal supports truecolor and most has correctly interpreted the escape sequence in the test file. The question is what does most see when man is used. Please try the following:

env PAGER=/bin/cat man ls > /tmp/ls.txt

Please send /tmp/ls.txt to me. Also, have you tried omitting "env" and just use

PAGER=./objs/most man ls

? Thanks

@sebastiencs
Copy link
Author

ls.txt

Please send /tmp/ls.txt to me. Also, have you tried omitting "env" and just use
PAGER=./objs/most man ls

I've tried yes, and also:

man --pager=./objs/most ls

They both show no colors

@jedsoft
Copy link
Owner

jedsoft commented Jun 19, 2022

There are no color escape sequences in the ls.txt file. This is why most does not display color. It seems to me that the problem you are experiencing is external to most.

@sebastiencs
Copy link
Author

This is strange that on version pre5.2-6, colors are displayed without any modification to the environment or to man itself.

On pre5.2.0-9, when I run most in binary mode, or with displaying controls characters, I can see the escapes sequences:

env PAGER="./src/objs/most -b" man ls

image

env PAGER="./src/objs/most -v" man ls

image

@jedsoft
Copy link
Owner

jedsoft commented Jun 20, 2022

Evidently man strips the highlighting sequences when stdout is redirected unless the MAN_KEEP_FORMATTING environment variable is defined. That is, produce the ls.txt file using:

 MAN_KEEP_FORMATTING=1 man ls > /tmp/ls.txt

Thanks

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

No branches or pull requests

2 participants