I don’t know why I use Warp since I’ve barely used the AI features. I was setting up my laptop when my friend suggested it to me, so I thought I’d give it a shot, and I’ve been using it ever since simply because I’m too lazy to switch.
Honestly, for my workflow, it feels pretty much the same as using iTerm2.
locale warning
When using the Warp terminal on macOS to connect to a server, I often see a messages like this:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
_____________________________________________________________________
WARNING! Your environment specifies an invalid locale.
The unknown environment variables are:
LC_CTYPE=UTF-8 LC_ALL=
This can affect your user experience significantly, including the
ability to manage packages. You may install the locales by running:
sudo dpkg-reconfigure locales
and select the missing language. Alternatively, you can install the
locales-all package:
sudo apt-get install locales-all
To disable this message for all users, run:
sudo touch /var/lib/cloud/instance/locale-check.skip
_____________________________________________________________________
or this:
bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
這是因為在 ssh 的時候也會把 macOS 的 local environments 也一起傳過去。
This happens because the SSH process forwards the macOS local environment variables to the remote server.
On macOS, LC_CTYPE defaults to UTF-8, which is formatted differently than what Debian expects (e.g., en_US.UTF-8). Consequently, Debian doesn’t recognize it.
The Solution
Now that we know why, the fix is to either pass a locale that’s supported by the Debian server or to configure the server to ignore whatever macOS sends over.
Pass the locale directly during SSH
This is the most direct method:
> LC_CTYPE=C.UTF-8 ssh <remote>
Add LC_CTYPE to .zshrc
export LC_CTYPE=C.UTF-8
Configure the server to ignore the value
On the server, look for AcceptEnv in /etc/ssh/sshd_config:
# Allow client to pass locale and color environment variables
AcceptEnv LANG LC_* COLORTERM NO_COLOR
Comment this line out. However, I’ve noticed that for servers I SSH into via Tailscale, this setting seems to be ignored, though I’m not entirely sure why.
Conclusion
I’m currently sticking with adding LC_CTYPE to my .zshrc to solve this.