WORK-IN-PROGRESS - Xfce4 terminal: how to correctly set $TERM to xterm-256color
Posted: 28 Oct 2023, 06:52
Above my issue, the bold and green text further down is about the solution. That for now not works for me - see also below, even further down than the quoted article from https://bbs.archlinux.org/ .
System Porteus 5.01 with XFCE 4.16 x86-64:
The themes really do annoy me in mc.
Tried several, but every one has at least one flaw when a certain file type (or worse even: file types) is not displayed at all.
My current theme (in mc's parlance that is Appearance / Skin) is darkfar
Trying 256 color skin gives me errors like this
My DE: XFCE 4.16 on Port 5.01; xfce4-terminal is V0.8.10
E.g. a folder listing looks like so for me using darkfar
When I move the cursor up it looks like so
and when I Dr. Copy and Mr. Paste the above it gets obvious that the two seemingly empty lines are black on black listings of files:
There are others out there with similar issues.
Seemingly a solution is to be found here: bbs.archlinux.org: [SOLVED] Xfce4 terminal: how to correctly set $TERM to xterm-256color
In other posts in this thread there are warnings and info why it is a bad idea to change globally all of the $TERM variable since that could lead to a broken terminal. Especially when you switch to a Virtual Terminal to do some emergency work or emergency recovery when your DE is no longer reacting, a broken terminal is the last thing you need. Or when you want / need to log into your system using ssh or any other remove access: once again, a broken terminal is the last thing you need.
To quote from the above linked forum post:
Some of my ~/.config/xfce4/panel/launcher-*/*.desktop have these entries:
and not the above mentioned
For now I created and edited ~/.local/share/applications/xfce4-terminal.desktop as described in the article as quoted above. Now I test a bit and see if that is sufficient already (I doubt that it will be), or if I need to use the same code as in the quote above, but replacing different code from my own ~/.config/xfce4/panel/launcher-*/*.desktop files.
I will be back to report.
Added in 9 minutes 52 seconds:
Nope, not really working.
For now only created and edited the ~/.local/share/applications/xfce4-terminal.desktop file:(I removed all language entries I am not interested in)
The "Terminal emulator" that sits in the main menu (not in any sub-menu) works as it should:
but I did not test that menu entry prior the above change. Maybe that entry worked fine all the time?
But when I try to start it via [main menu]/System/XFCE Terminal I get this error:

What does "Failed to execuve" mean? Is that a bug in XFCE 4.16 and should have read "Failed to execute"?
System Porteus 5.01 with XFCE 4.16 x86-64:
Code: Select all
guest@rava:~$ cat /etc/porteus/*
001-core.xzm:20230922
002-xorg.xzm:20231001
002-xtra.xzm:20230922
003-xfce.xzm:20230922
06-man.xzm:20230915
initrd.xz:20220928
Tried several, but every one has at least one flaw when a certain file type (or worse even: file types) is not displayed at all.
My current theme (in mc's parlance that is Appearance / Skin) is darkfar
Trying 256 color skin gives me errors like this
Code: Select all
┌────────────────────────────── Error ──────────────────────────────┐
│ │
│ Unable to use 'gray-green-purple256' skin with 256 colors support │
│ on non-256 colors terminal. │
│ Default skin has been loaded │
│ │
└───────────────────────────────────────────────────────────────────┘
E.g. a folder listing looks like so for me using darkfar
Code: Select all
←═ ...gs.default/extension-data ═•[↓]→╗
║↑m Name │ Size │Modify time ║
║/.. │UP--DIR│Oct 28 08:12║
║ ublock0.sqlite │ 62336K│Oct 28 08:06║
║ │ │ ║
║ │ │ ║
║ ematrix.sqlite │1277952│Oct 28 07:04║
║ │ │ ║
╟──────────────────────────────────────╢
║ ematrix.sqlite ║
╚═══════════════════ 789G/1829G (43%) ═╝
Code: Select all
←═ ...gs.default/extension-data ═•[↓]→╗
║↑m Name │ Size │Modify time ║
║/.. │UP--DIR│Oct 28 08:12║
║ ublock0.sqlite │ 62336K│Oct 28 08:06║
║ │ │ ║
║ ematrix.~ite.bak│1277952│Oct 28 07:04║
║ ematrix.sqlite │1277952│Oct 28 07:04║
║ │ │ ║
╟──────────────────────────────────────╢
║ ematrix.sqlite.bak ║
╚═══════════════════ 789G/1829G (43%) ═╝
Code: Select all
←═ ...gs.default/extension-data ═•[↓]→╗
║↑m Name │ Size │Modify time ║
║/.. │UP--DIR│Oct 28 08:12║
║ ublock0.sqlite │ 62336K│Oct 28 08:06║
║ ublock0.~ite.bak│7602176│Oct 28 07:04║
║ ematrix.~ite.bak│1277952│Oct 28 07:04║
║ ematrix.sqlite │1277952│Oct 28 07:04║
║ │ │ ║
╟──────────────────────────────────────╢
║ ematrix.sqlite ║
╚═══════════════════ 789G/1829G (43%) ═╝
Seemingly a solution is to be found here: bbs.archlinux.org: [SOLVED] Xfce4 terminal: how to correctly set $TERM to xterm-256color
In other posts in this thread there are warnings and info why it is a bad idea to change globally all of the $TERM variable since that could lead to a broken terminal. Especially when you switch to a Virtual Terminal to do some emergency work or emergency recovery when your DE is no longer reacting, a broken terminal is the last thing you need. Or when you want / need to log into your system using ssh or any other remove access: once again, a broken terminal is the last thing you need.
To quote from the above linked forum post:
Added in 12 minutes 16 seconds:sbs wrote:There are two steps to get this working in Xfce4.
1. Copy the system terminal .desktop file to the local config directory.
and edit the following two entries:Code: Select all
cp /usr/share/applications/xfce4-terminal.desktop ~/.local/share/applications/xfce4-terminal.desktop
with:Code: Select all
Exec=xfce4-terminal Terminal=false
2. This will correctly set the $TERM environment variable when the terminal emulator is launched from the Xfce applications menu, but not when launched from the default panel launcher.Code: Select all
Exec=env TERM=xterm-256color /bin/bash Terminal=true
On my system, the panel launcher for the terminal emulator was defined in a .desktop file in the directory ~/.config/xfce4/panel/launcher-*, where "*" is a number, which by default was being called with the commands:I could not figure out how to combine "exo-open" with "env", or any other way to set an environment variable with "exo-open", so I also replaced the two .desktop entries with:Code: Select all
Exec=exo-open --launch TerminalEmulator Terminal=false
and now everything works as expected.Code: Select all
Exec=env TERM=xterm-256color /bin/bash Terminal=true
Some of my ~/.config/xfce4/panel/launcher-*/*.desktop have these entries:
Code: Select all
Exec=xfce4-terminal
Terminal=false
Code: Select all
Exec=exo-open --launch TerminalEmulator
Terminal=false
I will be back to report.
Added in 9 minutes 52 seconds:
Nope, not really working.
For now only created and edited the ~/.local/share/applications/xfce4-terminal.desktop file:
Code: Select all
[Desktop Entry]
Version=1.0
Name=Xfce Terminal
Name[de]=Xfce-Terminal
Name[en_AU]=Xfce Terminal
Name[en_GB]=Xfce Terminal
Comment=Terminal Emulator
Comment[de]=Terminal-Programm
Comment[en_AU]=Terminal Emulator
Comment[en_GB]=Terminal Emulator
GenericName=Terminal Emulator
GenericName[de]=Terminal-Programm
GenericName[en_AU]=Terminal Emulator
GenericName[en_GB]=Terminal Emulator
Exec=Exec=env TERM=xterm-256color /bin/bash
Icon=org.xfce.terminal
Terminal=true
Type=Application
Categories=GTK;System;TerminalEmulator;
StartupNotify=true
Actions=preferences;
[Desktop Action preferences]
Name=Terminal Preferences
Name[de]=XFCE Terminal Einstellungen
Name[en_AU]=Terminal Preferences
Name[en_GB]=Terminal Preferences
Exec=xfce4-terminal --preferences
The "Terminal emulator" that sits in the main menu (not in any sub-menu) works as it should:
Code: Select all
guest@rava:~$ echo $TERM
xterm-256color
But when I try to start it via [main menu]/System/XFCE Terminal I get this error:

What does "Failed to execuve" mean? Is that a bug in XFCE 4.16 and should have read "Failed to execute"?