You are not logged in.

#1 2022-03-14 22:10:02

worbgge
Member
Registered: 2021-07-18
Posts: 48

tmux saying wrong locale when i have right locale

Hello, i have been having this issue on both my laptop and my desktop pc, it's an issue with tmux and it not having the right locale although i have selected the right locale.

Starting server...tmux: need UTF-8 locale (LC_CTYPE) but have ANSI_X3.4-1968
-
locale -a
C
POSIX
en_GB.utf8
-
locale-gen
Generating locales...
  en_GB.UTF-8... done
Generation complete.

Offline

#2 2022-03-14 22:19:04

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: tmux saying wrong locale when i have right locale

What does `locale` return?

Offline

#3 2022-03-14 22:35:10

worbgge
Member
Registered: 2021-07-18
Posts: 48

Re: tmux saying wrong locale when i have right locale

locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

Offline

#4 2022-03-14 22:36:02

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: tmux saying wrong locale when i have right locale

So that's your problem, you generated the locale, but didn't set it. What's in /etc/locale.conf?

Offline

#5 2022-03-14 22:39:58

worbgge
Member
Registered: 2021-07-18
Posts: 48

Re: tmux saying wrong locale when i have right locale

cat /etc/locale.conf
LANG=en_GB.UTF-8

Offline

#6 2022-03-14 22:40:48

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: tmux saying wrong locale when i have right locale

Then you've likely got something overriding it later. How are you logging in? What WM/DE?

Offline

#7 2022-03-14 22:42:43

worbgge
Member
Registered: 2021-07-18
Posts: 48

Re: tmux saying wrong locale when i have right locale

yeah that might be the issue, i use dwm and login through startx and have this option on .xinitrc

#Keyboard Layout
setxkbmap gb &

Offline

#8 2022-03-14 22:43:41

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: tmux saying wrong locale when i have right locale

So you log in at a tty, you start your graphical session with startx.

What shell? Before you startx, is `locale` the same? You can log into a second tty to check that.

Offline

#9 2022-03-14 22:46:03

worbgge
Member
Registered: 2021-07-18
Posts: 48

Re: tmux saying wrong locale when i have right locale

i use the zsh shell in tty and my terminal, this is the output of locale in the tty

LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

Offline

#10 2022-03-14 22:50:21

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: tmux saying wrong locale when i have right locale

So your problem is later. setxkbmap wouldn't do this, what else is in .xinitrc? Does dwm have any startup scripts? What terminal emulator?

Offline

#11 2022-03-14 22:53:33

worbgge
Member
Registered: 2021-07-18
Posts: 48

Re: tmux saying wrong locale when i have right locale

Scimmia wrote:

what else is in .xinitrc?

#!/bin/sh

while true; do
	xsetroot -name " Linux $(uname -r) | $(top -bn1 | grep Cpu | awk '{print $2}')% | $(free --mebi | sed -n '2{p;q}' | awk '{printf ("%2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}') | pac $(pacman -Qu | grep -Fcv "[ignored]") | weather $(curl -s "wttr.in/*?format=1" | grep -o ".[0-9].*") | $(cat /sys/class/power_supply/BAT0/status): $(cat /sys/class/power_supply/BAT0/capacity)% | $(date +"%H:%M") • $(date +"%a %d/%m/%Y")"
   sleep 5s
done &

# Programs to open on startup
flameshot &
unclutter &
dunst &
clipmenud &
redshift -l 53.480759:-2.242631 &

#Keyboard Layout
setxkbmap gb &

#Set background
feh --bg-center /home/*/.local/share/background_2.png &

exec dwm
Scimmia wrote:

Does dwm have any startup scripts?

no

Scimmia wrote:

What terminal emulator?

st

Offline

#12 2022-03-14 23:14:32

worbgge
Member
Registered: 2021-07-18
Posts: 48

Re: tmux saying wrong locale when i have right locale

ok i fixed it on my laptop (the /etc/locale.conf fixed it) but it is still different on my desktop pc.

locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

This is the same for the tty as well which uses zsh.

Offline

#13 2022-03-14 23:23:19

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: tmux saying wrong locale when i have right locale

If you aren't using OMZ, post your .zprofile and .zshenv files.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#14 2022-03-14 23:28:14

worbgge
Member
Registered: 2021-07-18
Posts: 48

Re: tmux saying wrong locale when i have right locale

don't have a zprofile file but this is my zshenv

 export ZDOTDIR=~/.config/zsh
 export HISTFILE=~/.local/share/zsh/history


# Ensure that a non-login, non-interactive shell has a defined environment.
if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
  source "${ZDOTDIR:-$HOME}/.zprofile"
fi

Offline

#15 2022-03-14 23:30:51

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: tmux saying wrong locale when i have right locale

If you don't have a zprofile, why is it sourced?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#16 2022-03-15 07:25:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,743

Re: tmux saying wrong locale when i have right locale

the /etc/locale.conf fixed it

localectl
locale -a
locale

Since $LANG is empty on the desktop "locale" output it's pretty much guaranteed that you don't have a properly configured locale.conf there either…
The video tutorial you follow to install arch forgets to mention https://wiki.archlinux.org/title/Locale

Online

Board footer

Powered by FluxBB