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

man/groff: man command shows some error of grotty / troff for non-console output #4339

Open
1 task done
KSR-Yasuda opened this issue Jan 10, 2024 · 4 comments
Open
1 task done
Labels

Comments

@KSR-Yasuda
Copy link

Description / Steps to reproduce the issue

With groff v1.23 package, man command output errors of grotty and troff as below.
It happens only for non-console output (i.e. redirected, or piped output).

% pacman -U groff-1.23.0-2-x86_64.pkg.tar.zst
% /usr/bin/man bash >/dev/null          # Error output as below w/ groff v1.23
grotty:<standard input>:(<standard input>):9: warning: unrecognized X command 'sgr 0' ignored
troff:<standard input>:2073: warning: cannot select font 'CW'
troff:<standard input>:3716: warning: cannot select font 'CW'
troff:<standard input>:3716: warning: cannot select font 'CW'
troff:<standard input>:5383: warning: cannot select font 'CW'
troff:<standard input>:5386: warning: cannot select font 'CW'
troff:<standard input>:5970: warning: cannot select font 'CW'
troff:<standard input>:5982: warning: cannot select font 'CW'
troff:<standard input>:7242: warning: cannot select font 'CW'

% groff --version
GNU groff version 1.23.0
Copyright (C) 2022 Free Software Foundation, Inc.
GNU groff comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of groff and its subprograms
under the terms of the GNU General Public License.
For more information about these matters, see the file
named COPYING.

called subprograms:

GNU troff (groff) version 1.23.0
GNU grops (groff) version 1.23.0

% pacman -Q groff
groff 1.23.0-2

This had not happened with groff v1.22 or before:

% pacman -U groff-1.22.4-4-x86_64.pkg.tar.zst
% /usr/bin/man bash >/dev/null          # No error output w/ groff v1.22

% groff --version
GNU groff version 1.22.4
Copyright (C) 2018 Free Software Foundation, Inc.
GNU groff comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of groff and its subprograms
under the terms of the GNU General Public License.
For more information about these matters, see the file
named COPYING.

called subprograms:

GNU grops (groff) version 1.22.4
GNU troff (groff) version 1.22.4

% pacman -Q groff
groff 1.22.4-4

Just calling man in bash console, it does not raise this error.

However, in vim's :Man command (enabled with :runtime ftplugin/man.vim line in .vimrc),
it does (probably :Man command redirects man output into some file).

Expected behavior

Do not show this error for non-console output.

Or is there any option or something to avoid this?

Actual behavior

As above.

Verification

Windows Version

MINGW64_NT-10.0-19045

Are you willing to submit a PR?

No response

@KSR-Yasuda KSR-Yasuda added the bug label Jan 10, 2024
@Biswa96
Copy link
Member

Biswa96 commented Jan 10, 2024

In my case, the /usr/bin/man bash >/dev/null command shows same output in msys2 and in bare metal ArchLinux installation. Also, the output looks like warnings only.

Here is the screenshot from ArchLinux.

image

@KSR-Yasuda
Copy link
Author

Thank you for checking.

I found the troff warnings can be suppressed by man --warnings=\!w,
but, still the grotty warning remains...

@KSR-Yasuda
Copy link
Author

https://lists.gnu.org/archive/html/groff/2023-07/msg00057.html#:~:text=You%20can%20arrange,to%20any%0Avalue%29%2E
This says to use env var MANROFFOPT="-c" or GROFF_NO_SGR, but these also do not work.

@KSR-Yasuda
Copy link
Author

Vim's :Man command looks trying to avoid this warning by ${GROFF_NO_SGR}:

" /usr/share/vim/vim91/autoload/dist/man.vim (Last Change: 2023 Jun 28)

101 func dist#man#GetPage(cmdmods, ...)

                                     (snip)

191   let env_cmd = s:env_has_u ? 'env -u MANPAGER' : 'env MANPAGER=cat'
192   let env_cmd .= ' GROFF_NO_SGR=1'
193   let man_cmd = env_cmd . ' man ' . s:GetCmdArg(sect, page)
194 
195   silent exec "r !" . man_cmd

                                     (snip)

216 endfunc

Is ${GROFF_NO_SGR} env var actually working?

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

No branches or pull requests

2 participants