-
-
Notifications
You must be signed in to change notification settings - Fork 999
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
:Git <any-command> --help
mishandles formatting
#2300
Comments
Relevant, and perhaps helpful: https://stackoverflow.com/questions/60106514/ |
This works fine on Linux, and I could have sworn it used to work fine on macOS. I wonder if something changed. https://unix.stackexchange.com/questions/13267/how-to-disable-styling-on-man-pages demonstrates the behavior I expect: ASCII style formatting is disabled when |
I agree it doesn't make sense for Fugitive to mess around with control bytes. I can see three possible fixes:
Obviously some of this doesn't make sense on Windows or other non-POSIXy platforms. The wrapper script might look like this:
(My shell script is rusty; take this with a grain of salt.) I'm willing to help in principle, but I'm not experienced with VIm scripting. |
We do always set Always setting
This is probably the least worst option. Inconvenient but not impossible. There's also
We already detect
This complicates the implementation, and is part of the "inconvenient", but not a deal breaker.
What is |
The idea of using a separate script was that we could set If you can pass git a config setting (you mentioned
Taking all of that into account, it sounds like the best approach might be (pseudo-code):
|
Looks like |
That works beautifully! Thank you, @tpope! |
Running e.g.
:Git commit --help
displays the relevant man page in a new window (as expected), but various formatting is mishandled, as shown in the following screenshot:IMO it would be more helpful to show a correctly formatted man page, but it would also be reasonable and preferable to suspend VIm and run the
man
process in the foreground.My quick read [edit: confirmed by an answer on StackOverflow]: the manpage viewer is using
^H
(backspace) to double-strike some characters for emphasis [edit: and overlay underscores with characters to simulate underlining] as might make sense on e.g. a dot matrix printer. For example, the sequence:D
^HDE
^HES
^HSC
^HCR
^HRI
^HIP
^HPT
^HTI
^HIO
^HON
^HN
...prints
D
, moves the carriage back one character, then printsDE
, and so on. This ultimately renders the wordDESCRIPTION
by double-striking each non-control character. The slight misalignment between the first strike and the second (no printer is that precise) would result in a bold rendition even on a plain-text printer.Debugging observations and platform details
set ft?
→ft=man
)0f693bf
man
andless
are supplied by the OS (at least, when invoked from the command-line)man
seems to have no version-reporting facilityless
reports its version (omitting the warranty statement) asThe text was updated successfully, but these errors were encountered: