-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Highlighting in nano broken after v2.45.2 #5462
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
Comments
Is this also broken in a regular MSYS2? |
I think it quite possibly is, since installing the latest version of MSYS2 (which has nano 8.3) and entering Although I do occasionally use regular MSYS2 I've never had a need to use highlighting in nano in it, so I never noticed the lack of coloring there before. I'd love to try to track this down but unfortunately regular MSYS2 doesn't provide a way of switching to specific older versions AFAIK, unlike GfW where the history of self-contained installers makes it easy to test. It looks like it might be possible to try specific older versions of individual packages but this technique doesn't accurately reproduce having an older version of the entire installation. Have you been able to reproduce the issue on your end? ScreenshotsMSYS2 - no coloringGfW 2.46.2 - broken: coloring, but no highlightingGfW 2.45.2 - working: coloring and highlightingApologies for the redaction, but you can still see the highlighting on the comments and the first character of the commit hash and message. I neglected to included it in the screenshot, but |
Based on a quick look, I think that all you need is to uncomment this line in
|
...indeed, you are correct. Somehow, I did think to check that the default setting of "is highlighting enabled" hadn't changed between versions, but not whether the highlighting files were included by default or not... Rather than editing With that aside: It looks like nano upstream has always had those inclusions disabled in its example config. Do you know what the origin of this change is? Both my MSYS2 installations have those inclusions disabled, so my guess now is that some very old version of Git for Windows set up some "helpful" defaults without making sure that they would be retained after an upstream update, and the recent minor upstream change to remove the double-quote characters on those lines overwrote the downstream change without anyone noticing. Would it be worth either restoring the previous default (if this was indeed an intentional decision by GfW originally) or putting a quick "the default has changed, here's what you need to do to keep old behavior" note in a changelog for anyone else who may get stung by this? |
Huh. I looked and looked and could not find anything, seeing as MSYS2's package recipe copied But then I looked at |
Unfortunately, the fix for this just missed the cut-off for v2.49.0-rc1; I am finishing the touches on the patch and will open a PR Real Soon Now™, though, and it should be in v2.49.0-rc2. |
Thanks again for looking at this! |
The [syntax highlighting of the `nano` editor was recently disabled](git-for-windows/git#5462) in Git for Windows by mistake, which [was fixed](#605). Signed-off-by: gitforwindowshelper[bot] <[email protected]>
I open Git Bash and run a Git command like
git commit --amend
orgit rebase -i HEAD^
- something that opens nano with a temporary file that ought to have Git-specific highlighting.Observed behavior in versions marked below as "broken": There is no highlighting. Additionally, on further investigation:
nano /etc/nanorc
also does not do any highlighting, implying it is probably an issue with highlighting overall, not Git-specificnano -z
, which according tonano -h
and the nano News page should list the names of available syntaxes, outputs nothingls /usr/share/nano
shows all the files I'd expect to seeThis happens both when using Git Bash (via MinTTY) and when using the Windows 11 Terminal Profile (created by selecting the relevant option in the installer).
As the last working version of Git for Windows contains nano 8.0, which does not support
nano -z
, my thinking here is that when nano added the-z
option, they also somehow broke something that the Git for Windows build relies on.Expected behavior: highlighting works and
nano -z
lists available syntaxes.Versions tested
Full install information
The text was updated successfully, but these errors were encountered: