WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: tmux and locales on rpi  (Read 196 times)

Offline vext01

  • Newbie
  • *
  • Posts: 6
tmux and locales on rpi
« on: June 06, 2026, 09:41:20 AM »
Hi!

I'd quite like to use tmux on tiny core on a raspberry pi.

I've managed to build it fine, but it doesn't currently run:

Code: [Select]
$ ./work/tmux-3.6b/tmux
tmux: need UTF-8 locale (LC_CTYPE) but have ANSI_X3.4-1968

Looking at the available locales:
Code: [Select]
$ locale -a
C
POSIX

So no UTF-8 support.

But I see there's a tmux tce for x64, so I wonder why it works there? Do you support more locales on x64, or maybe you patched tmux? Is there s a repo with a ports tree or build scripts where I can see how the x64 package was built?

If I can get it working, I'll happily try to make an extension for pi.

Cheers

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15642
Re: tmux and locales on rpi
« Reply #1 on: June 06, 2026, 09:46:27 AM »
You need to set a locale using the getlocale extension - see the info file for instructions.

Offline vext01

  • Newbie
  • *
  • Posts: 6
Re: tmux and locales on rpi
« Reply #2 on: June 06, 2026, 10:02:42 AM »
Ah hah!

OK, so after setting TERM to `vt100` (it didn't like `alacritty`), the script exits non-zero in silence:

Code: [Select]
$ sudo getlocale.sh
$

Using `sh -x` we see the problem:
Code: [Select]
$ sudo sh -x $(which getlocale.sh)
...
+ echo 'zh_TW.UTF-8/UTF-8 " " off \'
+ echo 'zh_TW/BIG5 " " off \'
+ echo 'zu_ZA.UTF-8/UTF-8 " " off \'
+ echo 'zu_ZA/ISO-8859-1 " " off \'
+ dialog --file /tmp/tmp.B4S2XJ
+ '[' 255 -ne 0 ]
+ exit 1

Code: [Select]
$ sudo dialog --file /tmp/tmp.B4S2XJ

Error: Expected 3 arguments, found extra 1.
Use --help to list options.

Is the package broken, or I'm a dummy?

Offline vext01

  • Newbie
  • *
  • Posts: 6
Re: tmux and locales on rpi
« Reply #3 on: June 06, 2026, 03:50:35 PM »
The problem is the trailing slashes in the file being fed into dialog. This diff (with setting TERM) makes the script run:
Code: [Select]
--- /usr/local/bin/getlocale.sh 2014-01-15 11:26:39.000000000 +0000
+++ getlocale.sh 2026-06-06 19:19:01.000000000 +0000
@@ -10,7 +10,7 @@

 echo "--separate-output --checklist \"Choose which locales to support:\" 0 42 10 " > $temp2
 for i in `cat $SFILE`; do
- echo "$i \" \" off \\" >> $temp2
+ echo "$i \" \" off" >> $temp2
 done

 dialog --file $temp2 2> $tempfile

But alas, something is segging:
Code: [Select]
ow processing... Segmentation fault

Locales installed. Creating extension... /

Done. The extension is at /mnt/mmcblk0p2/tce/optional/mylocale.tcz and in onboot.lst
Reboot with lang=xyz (for example lang=en_US.UTF-8) to start using this.


Press enter to quit.

I think this extension needs some love.

Offline vext01

  • Newbie
  • *
  • Posts: 6
Re: tmux and locales on rpi
« Reply #4 on: June 06, 2026, 04:00:11 PM »
After a few more tries (this time with en_US.UTF-8), I managed to get it to work. tmux also runs.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12830
Re: tmux and locales on rpi
« Reply #5 on: June 06, 2026, 05:01:06 PM »
Hi vext01
Welcome to the forum.

First of all, let me congratulate you on your success and
your perseverance.

I remember dealing with Xdialog on several occasions, and trying to
track down errors based on a vague error message. It was quite
maddening because it appeared to be a catch all error message that
was along the lines of "one or more of your parameters are wrong" and
then it would present the help screen.

The first time was a little app for testing different screen resolutions
while Xorg was running:
https://forum.tinycorelinux.net/index.php?topic=27582.0

Then a small app for changing which mirror to use:
https://forum.tinycorelinux.net/index.php?topic=27986.0

The last one was a segfault another forum member reported:
https://forum.tinycorelinux.net/index.php?topic=28002.0

Offline vext01

  • Newbie
  • *
  • Posts: 6
Re: tmux and locales on rpi
« Reply #6 on: June 06, 2026, 06:09:53 PM »
Hi,

Well thanks. It's not my first rodeo either. I've been an OpenBSD packager for coming up 20 years!

I've just submitted tmux for 64-bit arm. Fingers crossed it's accepted.

While I'm here, I have some noob questions, if you don't mind.

I got into tiny core via picoreplayer. I remember reading that the system runs
entirely out of ram, so you can pull the power and no issues. But I notice on
my tinycore system:

Code: [Select]
/dev/mmcblk0p2 on /mnt/mmcblk0p2 type ext4 (rw,relatime)

That wouldn't be OK to pull the plug on AFAIK?


I understand this is the way to set the timezone:

Code: [Select]
tc@box:~$ export TZ=Europe/London
tc@box:~$ date
Sat Jun  6 10:04:59 PM Europe 2026

But it's an hour off. What gives?

Also when I run git log, less doesn't interpret the escape sequences for (i assume) colours, e.g.:
Code: [Select]
$git log
[[33mcommit bf7d5289f605bf04eb179e117bd55b292b08c639[[m[[33m ([[m[[1;36mHEAD -> [[m[[1;32mmain[[m[[33m, [[m[[1;31morigin/main[[m[[33m)[[m
...

but it's fine with:
Code: [Select]
git log | less

I assume this is some quirk of busybox?

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12830
Re: tmux and locales on rpi
« Reply #7 on: June 06, 2026, 08:30:57 PM »
Hi vext01
... I got into tiny core via picoreplayer. I remember reading that the system runs
entirely out of ram, so you can pull the power and no issues. But I notice on
my tinycore system:

Code: [Select]
/dev/mmcblk0p2 on /mnt/mmcblk0p2 type ext4 (rw,relatime)

That wouldn't be OK to pull the plug on AFAIK? ...
That might cause an issue if there were a write in progress when
that occurred.

PicorePlayer probably has a  copy2fs.flg  file in its  tce  directory
which instructs the system to copy extensions to RAM instead of
loop mounting them. Then the storage device can be unmounted
after booting. I'm guessing PicorePlayer does not have persistent
/home or /opt directories?



Quote
... I understand this is the way to set the timezone:

Code: [Select]
tc@box:~$ export TZ=Europe/London
tc@box:~$ date
Sat Jun  6 10:04:59 PM Europe 2026

But it's an hour off. What gives? ...
Is this still piCore? Maybe your RTC is off?
Is this Tinycore? Are you dual booting with Windows?

Quote
... Also when I run git log, less doesn't interpret the escape sequences for (i assume) colours, e.g.:
Code: [Select]
$git log
[[33mcommit bf7d5289f605bf04eb179e117bd55b292b08c639[[m[[33m ([[m[[1;36mHEAD -> [[m[[1;32mmain[[m[[33m, [[m[[1;31morigin/main[[m[[33m)[[m
...
...
I just tried that under TC10 x86 and TC14 x86_64 and they both showed
pretty yellow text.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12830
Re: tmux and locales on rpi
« Reply #8 on: June 06, 2026, 08:58:53 PM »
Hi vext01
By the way, you can also pass tz as a boot code so it's in the
global environment, like this:
Code: [Select]
tz=Europe/London

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12830
Re: tmux and locales on rpi
« Reply #9 on: June 06, 2026, 09:05:38 PM »
Hi vext01
And do you have tzdata.tcz installed?

Online patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 847
Re: tmux and locales on rpi
« Reply #10 on: June 06, 2026, 11:44:09 PM »
And like a beginner of TinyCore or PiCore is this context, you can read RT(F)ineM :)

http://tinycorelinux.net/corebook.pdf

And like Rich says there are a lot of settings being set with the kernel command line arguments.
https://distro.ibiblio.org/tinycorelinux/faq.html#bootcodes

And you can also read a lot on our wiki pages
https://wiki.tinycorelinux.net/doku.php?id=welcome
« Last Edit: June 06, 2026, 11:49:06 PM by patrikg »

Offline vext01

  • Newbie
  • *
  • Posts: 6
Re: tmux and locales on rpi
« Reply #11 on: Today at 04:13:59 AM »
Hi,

Thanks for your responses.

Quote
PicorePlayer probably has a  copy2fs.flg  file in its  tce  directory

I just checked my picoreplayer systems. Even those not running the lyrion server have that fs mounted r/w. and no `copy2fs.flg` file. I guess they rely on there not being writes on that filesystem for normal usage.

Quote
Is this still piCore? Maybe your RTC is off?

It's picore, yeah. I'm not sure how it works on a rpi. There's no battery to keep the time, that's for sure.

I had already tried the `tz` bootcode too. The incorrect result is the same.

I looked on my picoreplayer boxes, where the date is correct. They use a TZ of `GMT0BST,M3.5.0/1,M10.5.0`.

Code: [Select]
tc@box:~$ TZ=Europe/London date
Sun Jun  7 08:09:56 AM Europe 2026
tc@box:~$ TZ=GMT0BST,M3.5.0/1,M10.5.0 date
Sun Jun  7 09:09:59 AM BST 2026

So `Europe/London` gives the wrong time on tc.

Quote
I just tried that under TC10 x86 and TC14 x86_64 and they both showed pretty yellow text.

This remains a mystery. It's definitely to do with colours, as this works fine (albeit with no colour):
Code: [Select]
git log --color=never

Quote
http://tinycorelinux.net/corebook.pdf

Oh, I've been reading it, don't worry!

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12830
Re: tmux and locales on rpi
« Reply #12 on: Today at 07:12:09 AM »
Hi vext01
... It's picore, yeah. I'm not sure how it works on a rpi. There's no battery to keep the time, that's for sure. ...
/etc/init.d/tc-config  calls  /etc/init.d/settime.sh.
Once the network is up,  /etc/init.d/settime.sh  calls  /usr/bin/getTime.sh

Quote
... I looked on my picoreplayer boxes, where the date is correct. They use a TZ of `GMT0BST,M3.5.0/1,M10.5.0`. ...
I just checked tzdata.tcz:
Code: [Select]
tc@HP-G62:~$ strings /usr/local/share/zoneinfo/Europe/London
TZif2
TZif2
BDST
GMT0BST,M3.5.0/1,M10.5.0
It sounds like either tzdata is not installed or it's not listed in onboot.lst.

I think using the boot code:
Code: [Select]
tz=GMT0BST,M3.5.0/1,M10.5.0without tzdata.tcz should also be fine.