You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

git output in Terminal weird

When I run "git show" the output has started to look weird.

Now here is the weird thing: I log in with ssh on another machine and do the same and the output there is fine:



The following might be of importance (though I am not certain): I just removed and reinstalled the command line tools for Xcode because I had this problem:

2022-07-31 10:21:36.210 xcodebuild[1455:2480904] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-07-31 10:21:36.210 xcodebuild[1455:2480904] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore


These error messages appear when using several commands and they come with a timeout of sorts. So I ran


sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install


Back to that output. It seems Terminal works fine. But output on my system where I reinstalled the command line tools isn't. What might be going on here?

Posted on Jul 31, 2022 1:28 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 1, 2022 3:37 AM

Maybe I should have simply asked: "why does git status display colors perfectly and does git show produce this mess — both in the same shell?" There is something in the environment that drives this, apparently. And both commands get exact the same environment.


I actually found the culprit. It is the LESS environment variable. If it is set to any value, even empty, I get the mess.


PS. @etresoft It has nothing to with homebrew or macports the like. (I have no homebrew on my system, I've dumped that for macports because homebrew's security model has a fundamental flaw and because homebrew does not have what I need). I haven't had any problem like this with MacPorts (so, not that common for me at least).

Similar questions

13 replies
Question marked as Top-ranking reply

Aug 1, 2022 3:37 AM in response to MrHoffman

Maybe I should have simply asked: "why does git status display colors perfectly and does git show produce this mess — both in the same shell?" There is something in the environment that drives this, apparently. And both commands get exact the same environment.


I actually found the culprit. It is the LESS environment variable. If it is set to any value, even empty, I get the mess.


PS. @etresoft It has nothing to with homebrew or macports the like. (I have no homebrew on my system, I've dumped that for macports because homebrew's security model has a fundamental flaw and because homebrew does not have what I need). I haven't had any problem like this with MacPorts (so, not that common for me at least).

Jul 31, 2022 6:01 AM in response to Gerben Wierda

That GNU Less wants to use the Termcap/Terminfo database. Do you have your Terminal Preferences > Profiles > Advanced:


Declare terminal as: [ xterm-256color ]

Text encoding: [ Unicode (UTF-8) ]


Although I do not use git (and I should…), this is how my Apple Terminal is set.


You may need to pipe that git output through less -r too.

Jul 31, 2022 6:48 AM in response to VikingOSX

My Terminal is set the same. Setting CLICOLOR=1 in the environment and 'ls' shows colours too.


`git` and `less` are both from Apple. Terminal is from Apple. `zsh` is from Apple. So, why is `git show` showing this garbage while `git status` does a nice overview using color?


I can try color off which removes the garbage and all color.


git config --global color.ui false

Jul 31, 2022 9:48 AM in response to Gerben Wierda

Back in the 1980s and long before graphical interfaces were common, dumb terminals (DEC VT100, DEC VT220, etc) used what are called ANSI escape sequences or ANSI control sequences to control the displays.


You’re seeing those same control sequences displayed, which means the terminal you’re using is not interpreting the sequences, and (worse) not ignoring them as it should (for sequences not understood).


Escape [ 33 m


sets the foreground text color to yellow.


Here’s an intro: https://wiki.bash-hackers.org/scripting/terminalcodes


The output is fine and not-fine because the terminal types and terminal capabilities and character encoding are set correctly in one place, and are not set correctly in the other.


Use the Terminal preferences, or set the TERM environment variable terminal type from the command line.


Change Profiles Advanced preferences in Terminal on Mac - Apple Support (that’s part of the Terminal app user manual)


Xcode is completely unrelated to this.


There are lots of manuals on this topic for the old DEC terminals at the vt100.net website, too.


Jul 31, 2022 12:33 PM in response to MrHoffman

I am aware that Synology offers a git server solution, and I am running an ancient version of DSM 5 on a 2012 era DiskStation. So far, it has worked reliably, and if I were to upgrade to a new Synology box and DSM 7.x, then I would consider implementing a git solution on it.


I think I looked into git circa DSM 5 and there was some unremembered reason why I didn't set up git on it.


Will certainly bookmark the link, thanks.

Aug 1, 2022 3:01 PM in response to Keith Barkley

What I am thinking about is a separate folder repository for each of the languages I develop in, and then store those under a parent folder on iCloud Drive. Time Machine on my Mac backs up the latter, as I do not use Time Machine on the Synology for backups there.


I have code scattered across several Macs and operating systems — so a sizable re-organization issue before I get around to check-ins at the respective repositories. D'uh.

git output in Terminal weird

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.