Trying to run kitty terminal from .desktop file python LOCALE error

I’m trying to run kitty terminal in my fedora-toolbox-32. If I open gnome-terminal I can run kitty no problem. In my desktop file I have:

Exec=toolbox run -c fedora-toolbox-32 /usr/bin/kitty %F

if I use gtk-launch kitty.desktop I get the following:

Traceback (most recent call last): File "/usr/bin/../lib64/kitty/kitty/main.py", line 351, in main _main() File "/usr/bin/../lib64/kitty/kitty/main.py", line 291, in _main locale.setlocale(locale.LC_ALL, '') File "/usr/lib64/python3.8/locale.py", line 608, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting

OK I seem to get there that within my gnome-terminal the locale is set, but not when running from .desktop file. I tried putting a LANG=C before the toolbox run, with various unsuccessfull quoting attempts.

Hey I always end up going back to gnome-terminal anyways, but if anyone confined at home has a suggestion here it would be appreciated…

Can I ask why you are trying to run Kitty from a toolbox rather than just installing it on your host machine?

And also does %F not mean use the application to open a list of files? Have you tried just /usr/bin/kitty?

Thanks for the reply; always appreciated!

Yes, I don’t want to layer trivial stuff on my host machine. It should run in a container.

But the error is clearly a LOCALE environment error.

Just an FYI, you can run gnome-terminal in a toolbox from a desktop file. I also installed alacritty from a copr and it also runs fine so maybe I will stick with that. Both kitty and alacritty are gpu accelerated terminals, but I would prefer kitty as it is included with fedora. To me looks like some kitty/python issue.

It’s not a kitty or python issue, I’ve used a toolbox container to build kitty and not had any issues.

To resolve the issue with LOCALE you can set your desired LANG in /etc/locale.conf in the toolbox and install the required language pack glibc-langpack-en for example. I don’t however think that that will solve your issue.

Could you run toolbox run kitty on your host system and share the output please.

Sorry I was sidetracked for the last couple of days. But yes the out put is the same as above:

`]$ toolbox run kitty
[092 11:05:00.299030] Traceback (most recent call last):
  File "/usr/bin/../lib64/kitty/kitty/main.py", line 351, in main
    _main()
  File "/usr/bin/../lib64/kitty/kitty/main.py", line 291, in _main
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib64/python3.8/locale.py", line 608, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting`

my /etc/locale.conf contains only a basic LANG=“en_US.UTF-8” in both the host and guest. Absolutely nothing out of the ordinary. And I can run serveral terminals allacritty, gnome-terminal

So I’m really still thinking its a kittty issue that is not grabbing the LANG unless it itself is started from a terminal.

Hmm… interesting. I just tried kitty in a new toolbox. I get a similar error when not using C as a locale but it still runs fine.
[092 16:57:23.326014] Failed to set locale with LANG: en_GB.UTF-8

If you have tried the following then I am all out of ideas:

  • setting LANG="C.UTF-8" in /etc/locale.conf installing
  • Exec=env LANG="C.UTF-8" kitty in your .desktop file
  • Installing glibc-langpack-en