I do not understand why the active terminal command line is highlighted. I am using iTerm2 and also have zsh and oh-my-zsh installed, but even after disabling them I still see this. Any ideas?
Macos – iTerm window highlighted on the current line
itermmacosterminal
Related Solutions
man ls
has additional information on color listings.
Using the -G
flag with ls
ought to enable colour, if your shell's $TERM environment is set to a colour-capable value.
To have colour listings be the default of ls
, the CLICOLOR
environment variable can be set (to anything, even '') in the appropriate login script file.
It's either done like this:
CLICOLOR=''; export CLICOLOR
or
setenv CLICOLOR
depending on what login shell you use.
For interactive as-you-type colourizations...
There are quite a few add-ons for the zsh
shell. A google search on "color completion zsh" will return dozens of articles on how to set up coloured prompts and file-completion.
I did come across a reference to fish
, a Friendly Interactive Shell. I installed it on my Mac, and it appears to work as you've indicated.
If which fish
gives a Command not found
error, you'll have to install it from the official fish homepage.
One can inspect the list of files installed by a Homebrew formula via brew list -f <formula_name>
. In this case, the output should like
> brew list -f z
/usr/local/Cellar/z/1.9/etc/profile.d/z.sh
/usr/local/Cellar/z/1.9/INSTALL_RECEIPT.json
/usr/local/Cellar/z/1.9/README
/usr/local/Cellar/z/1.9/share/man/man1/z.1
Note that in this case there's no command (and not even bin
), just a z.sh
. This makes sense because z
is a shell tool, and have to be sourced into the shell as functions to get and set the shell environment; running as an external command simply doesn't offer deep enough integration. Therefore, you have to source z.sh
into your shell, probably in .bash_profile
, .bashrc
, or .zshrc
.
Usually, Homebrew formulae that require post-installation interactions in order to be usable will have instructions listed in caveats, which will be shown post-install, or manually retrieved via brew info <formula_name>
. In this case,
> brew info z
<irrelevant info omitted>
==> Caveats
For Bash or Zsh, put something like this in your $HOME/.bashrc or $HOME/.zshrc:
. `brew --prefix`/etc/profile.d/z.sh
Of course you should take that advise with a grain of salt, and use more modern and human-readable shell syntax:
source "$(brew --prefix)/etc/profile.d/z.sh"
Or
source /usr/local/etc/profile.d/z.sh
if you know your Homebrew installation is in /usr/local
.
Best Answer
This is an iTerm option which can be enabled or disabled using the "View > Show Cursor Guide" menu item, or with ⌘+⎇+;.