Is there a configuration option to set LC_CTYPE? #3345
anttikissa
started this conversation in
General
Replies: 1 comment 1 reply
-
Use the env directive in kitty.conf to set any env var you like. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First of all, I'm on macOS 11.1 and kitty version 0.19.3.
I just changed to kitty and noticed that when running kitty from the system launcher (as opposed from another terminal, where LC_CTYPE is already set in environment), LC_CTYPE is not set to UTF-8, and this caused some things to break. In particular, vim thinks that my .vimrc is encoded in latin1 (which it isn't), leading to errors.
I can work around this by setting LC_CTYPE=UTF-8 in .zshrc, but that only works for my shell - for instance when using the Preferences menu option to edit kitty config file, I get the same .vimrc error (I took me a while to realize that this happens because encoding issues):
I looked into how other terminals set LC_CTYPE, and found settings for it in Terminal.app and iTerm2:
Terminal has Profiles -> Advanced -> Set locale environment variables on startup:
iTerm2 has Profiles -> Terminal -> Set locale variables automatically
Unchecking these options unsets LC_CTYPE, and running
locale
showsLC_CTYPE="C"
. And I get the same vim error.As far as I can remember, I have never touched these options, so I assume UTF-8 is the default nowadays. My memory could fail me though.
Is there a configuration option to set LC_CTYPE to a given value? It might even make sense to default this to UTF-8, if the system doesn't provide a default value for this. (Not sure about different systems and languages, but as an European Mac user that would seem like a reasonable default.)
Beta Was this translation helpful? Give feedback.
All reactions