Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: vext01 on June 06, 2026, 09:41:20 AM

Title: tmux and locales on rpi
Post by: vext01 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
Title: Re: tmux and locales on rpi
Post by: Juanito on June 06, 2026, 09:46:27 AM
You need to set a locale using the getlocale extension - see the info file for instructions.
Title: Re: tmux and locales on rpi
Post by: vext01 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?
Title: Re: tmux and locales on rpi
Post by: vext01 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.
Title: Re: tmux and locales on rpi
Post by: vext01 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.
Title: Re: tmux and locales on rpi
Post by: Rich 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
Title: Re: tmux and locales on rpi
Post by: vext01 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?
Title: Re: tmux and locales on rpi
Post by: Rich 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.
Title: Re: tmux and locales on rpi
Post by: Rich 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
Title: Re: tmux and locales on rpi
Post by: Rich on June 06, 2026, 09:05:38 PM
Hi vext01
And do you have tzdata.tcz installed?
Title: Re: tmux and locales on rpi
Post by: patrikg 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
Title: Re: tmux and locales on rpi
Post by: vext01 on June 07, 2026, 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!
Title: Re: tmux and locales on rpi
Post by: Rich on June 07, 2026, 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.
Title: Re: tmux and locales on rpi
Post by: vext01 on June 07, 2026, 01:21:31 PM
Quote
It sounds like either tzdata is not installed or it's not listed in onboot.lst.

And you would be right. tzdata.tcz doesn't seem available for picore!
Title: Re: tmux and locales on rpi
Post by: vext01 on June 11, 2026, 05:32:16 PM
I now have an extension for tmux on 32-bit arm too  :D

(I submitted the 64-bit arm extension at the weekend)
Title: Re: tmux and locales on rpi
Post by: Rich on June 11, 2026, 10:29:30 PM
Hi vext01
Did you read about submitting in the Wikis Creating Extensions section:
https://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions#submitting
Title: Re: tmux and locales on rpi
Post by: vext01 on June 12, 2026, 03:13:52 AM
Hey Rich,

Yep, I followed those instructions. Got a clean submitqc run, tarred and bcrypted, then mailed to the tcesubmit gmail account.

I've automated it all, so that I can update things easily later:
https://github.com/vext01/tc_extensions

Cheers
Title: Re: tmux and locales on rpi
Post by: Juanito on June 12, 2026, 03:42:12 AM
found it in the spam - posted
Title: Re: tmux and locales on rpi
Post by: Rich on June 12, 2026, 12:18:47 PM
Hi vext01
... Got a clean submitqc run, ...
Does that mean your report on submitqc and ldd:
https://forum.tinycorelinux.net/index.php?topic=28174.0
is not an issue?
Title: Re: tmux and locales on rpi
Post by: vext01 on June 13, 2026, 02:42:27 PM
Quote
Does that mean your report on submitqc and ldd is not an issue?

Well... it was a clean run apart from that. That bug doesn't actually halt the script.

So yeah, the bug still stands.