Fixing Perl warning: setlocale: LC_CTYPE: cannot change locale

I use iTerm and SSH to connect to servers for executing various deployment and scripts for my daily basis activities. Basically, I spent 80% of my work hours on this black screen. Recently, I started seeing this error on my macOS:

This is because if you are using SSH, there are 2 variables which need to be set on the local machine, which gets passes down to your server when you connect via SSH.

After adding the following lines to ~/.bash_profile on my notebook, the warning went away:

Or to add it from the command line:

Validating it:

That’s it! See you next!

Leave a Reply