0

Every time I open the terminal I see the following message:

/etc/zshrc:7: command not found: locale

This is the first 7 lines in the file /etc/zshrc:

# System-wide profile for interactive zsh(1) shells.

# Setup user specific overrides for this in ~/.zshrc. See zshbuiltins(1)
# and zshoptions(1) for more details.

# Correctly display UTF-8 with combining characters.
if [[ "$(locale LC_CTYPE)" == "UTF-8" ]]; then
    setopt COMBINING_CHARS
fi

What should I do to this file to fix the problem?

Safa Amasha
  • 1
  • 1
  • 1
  • 1
    Is the binary `/usr/bin/locale` present on your system ? If so, modify PATH or equivalent so that it can be found. https://apple.stackexchange.com/questions/275343/how-do-i-add-a-directory-to-path-when-using-zsh-in-sierra – anki Mar 20 '21 at 13:33
  • 1
    What is the content of `/etc/paths`? – nohillside Mar 20 '21 at 15:08
  • Also, what's in your `~/.zprofile` and `~/.zshenv` (if they exist), and what does `printf '%s\n' $path` print? (Edit these into the question, using code format so they're readable.) – Gordon Davisson Mar 20 '21 at 23:53

1 Answers1

1

Your zsh environment isn't finding locale in its PATH.

Either call locale by its full path:

if [[ "$(/usr/bin/locale LC_CTYPE)" == "UTF-8" ]]; then

..or update your $PATH to make sure that /usr/bin is included.

da4
  • 5,232
  • 1
  • 19
  • 32