Backspace deletes only part of a unicode character

I may have missed it in the thread but did you check which locales are actually enabled and then try regenerating them?

grep -v ^# /etc/locale.gen

sudo locale-gen

I just tried this and it works as it should - for me.
(Xfce with bash in xfce4-terminal)

and:

gives the same result for me:

$ grep -v ^# /etc/locale.gen

en_US.UTF-8 UTF-8
hr_HR.UTF-8 UTF-8

$ stty -a | sed -n -e 's/^.*\; erase \= //p' | cut -d\; -f1
^?

I just searched for “backspace in terminal only deletes one byte of multibyte character stty iutf8” and found many interesting results:

Seems like this rabbit hole is a bit deeper than I expected. Just tried stty iutf8 without success.

Could be due to kernel version as well:

$ uname -r 
5.15.91-1-MANJARO

I run the same (in a VM)
all works there, as well as here:

uname -r
6.1.9-zen1-1-zen

Arch (EOS)

first of your above links got me to /etc/inputrc which is in the “readline” package
but I don’t suppose you touched that

Is it terminal specific? (tried a different terminal?)

I had some weird behaviour when I installed Archlabs a couple of years ago - they used zsh and some strange configuration
which made it impossible to use mc properly.

Perhaps I’ll find that issue again and what caused it …

I just tried my newest Linux Mint MATE as a VM, running zsh and I can’t reproduce that issue over there. I also ran bash there and same thing - all good.

❯ uname -r
5.15.0-58-generic

❯ grep -v ^# /etc/locale.gen


en_US.UTF-8 UTF-8
hr_HR.UTF-8 UTF-8

I just ran zsh on my main Manjaro - I can still reproduce the same issue, which may indicate that the issue could be really terminal related. So, I ran my last available terminal emulator in Kate:

$ basename "/"$(ps -o cmd -f -p $(cat /proc/$(echo $$)/stat | cut -d \  -f 4) | tail -1 | sed 's/ .*$//')
kate

But I could reproduce the same issue there.

Just an idea I got while skimming this topic.
I don’t see any info mentioned about which Terminal emulator you use. Could there be a difference in how they behave, like settings etc?
Konsole I believe is standard in Plasma (it’s what I use anyway) but it can be replaced if one has other needs/interests for features that only exist in other emulators.
Just a thought.

No one seems to be able to reproduce the issue.

Don’t know whether @Jazz tried to use the default profile in Konsole - which is,
at least when the system was installed fairly recently,
running the zsh shell.

Perhaps something global in /etc
/etc/profile, for instance
or some change to some file in ~/.config

Most of those are auto-generated
can be removed (or backed up) and will be recreated

/etc/skel is another place to look - those are the defaults for a fresh user
and can be compared to what is currently in ~/.config

I suggested checking and regenerating the enabled locales.
Feedback was: he checked and it was ok -
but did he, just to be sure, also regenerate them? Don’t know.

I did mention it here - I use the default profile in Konsole, Yakuake and my IDE’s terminal emulators (Kate and VSCodium).

I never changed the global settings in /etc. Speaking of ~/.config, same things happen when I sudo su which completely has its own default settings - I could always recreate this issue on Manjaro. Hence I doubt I’m the only one facing this issue, since the sample in this thread is too small.

I did. No effect.

An interesting plot twist: I just created a new user, logged in there, opened the default Konsole and… the issue is not there! What kind of sorcery is this? :roll_eyes:

Not to be contrarian - just observations/facts:

as of now/currently - the default profile is read only and is using zsh
your installation is likely from before that (to me rather silly) change - so you still can have Bash without “contorsions”
(it involves creating a new profile and setting this as default …)

I totally believe you!
Why would you …

it’s not quite accurate (IMO)
sudo su -
will get root’s environment
sudo su
will not

I could not.
And, as you know from your research, similar problems are rarely reported and working advice is hard or impossible to find.

But I don’t have installed any IDE.

the kind of plot twist you might have had earlier
when you had backed up and then deleted all your settings in ~/.config
like I suggested :wink:

So:
the issue is as close to be resolved as it can get I recon …

Good on you!

That’s true. I use Manjaro for over 2 years now, when bash was still the default shell. Hm… that sounds about right. So, hopefully new profile in Konsole will do the trick.

That’s true as well - just tried sudo su - and I can’t recreate the issue there.

I’ll take another stab at it tomorrow and will report here. I think creating a new profile should resolve it. :smile: Curious as I am, I will compare the two ~/.local/share/konsole and hopefully we will find the real culprit for all this trouble.

I would do that as well - just out of curiosity.

My favorite candidate was:
~/.config/kcminputrc
(based upon … nothing remotely tangible)

who knows - maybe you will, soon :nerd_face:

1 Like

Found it! When I compared the new profile settings with the old one, there were no significant changes and the issue was still there, even with the new profile in my Konsole. Then I ran locale -v at my brand new account that works fine and doesn’t have the original issue, then I found it throws this:

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

Which is the only big difference from my output (pasted in my original post above):

$ locale -v
LANG=hr_HR.UTF-8
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=C

I knew that was my main culprit and I was even more confident when I read the first comment again.

The solution was there the whole time, within the first comment above, but since sudo localectl set-locale LC_CTYPE="hr_HR.UTF-8" didn’t work for me, this time I was more careful and went through all my .*rc files and found this in my .bash_profile which I previously overlooked:

#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
export LC_ALL="C"
export LC_CTYPE="hr_HR.UTF-8"

… but the export LC_CTYPE="hr_HR.UTF-8" part was completely ignored by the script! Now I changed it to:

#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
export LC_ALL="hr_HR.UTF-8"
export LC_CTYPE="hr_HR.UTF-8"
export LANG="en_US.UTF-8"

Tadaa! Now everything works like it should! Since LC_CTYPE really was my main culprit, I will mark that as a solution. Thanks!

P.S.

My LANG is still set to hr_HR.UTF8, like the export LANG="en_US.UTF-8" part is also completely ignored after I set export LC_ALL="hr_HR.UTF-8", just like the LC_CTYPE. Hence, my Manjaro is not in English now. Any final tip to fix that issue? The following 3 lines will resolve the final issue:

unset LC_ALL
export LANG="en_US.UTF-8"
export LC_CTYPE="hr_HR.UTF-8"
1 Like

The way I see this is:

none of your changes should be there, at all

just leave that file alone - no additions at all

the main culprit was you, adding to/editing
~/.bash_profile

Had you put nothing in it
and left it as it was:

#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc

all would have been fine

In fact - the new modifications to it don’t improve things.
Without them it works just as well.

Just leave it be - in it’s original state.
see above

I’d like to believe this is true, but when I remove all those additions from my .bash_profile, then restart my machine, all my GUI applications start displaying app menus in Croatian, which I don’t want. I specifically set the LANG to “en_US.UTF-8” within /etc/locale.conf, /etc/default/locale, by running sudo localectl set-locale LANG="en_US.UTF-8" then sudo locale-gen followed by restart, but regardless all that, the locale -v would always output LANG=hr_HR.UTF-8. Doesn’t make any sense. What am I missing?

The above content of my .bash_profile is a workaround to have my locales set the way I want.

What if you use Manjaro Settings Manager to set your language and all?

I tried that and it doesn’t change anything, but I’ve noticed a conflict between the System Settings and Manjaro Settings Manager, take a look:

When I click at “Modify” (yellow rectangle, as a part of System Settings), even when I select English, this setting always remains at “Croatian”. The Manjaro Settings Manager (from the right) shows the correct distribution of languages, but the system doesn’t follow those settings.

Since this is a separate issue, I created a new thread here:

In the Manjaro Settings Manager page you can also click Detailed Settings so you see them all.

I know. It doesn’t help. All this mess was created by Plasma. I gave the answer in my separate issue above.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.