If you type any number of non-English Unicode characters, e.g. “öäüčđž” and then use your backspace key to delete those, then immediately start typing any of valid commands, the result will be quite unexpected:
$ ls -al
bash: $'\303\266\303\244\303\274\304ls': command not found
Only parts of each Unicode character are deleted due to the setting stty erase ^?.
I tried to set stty erase ^H, by using Ctrl+V+backspace, but that didn’t resolve my issue. Any ideas?
It doesn’t help even if I place export LC_CTYPE="hr_HR.UTF-8" to my .bash_profile. My LC_CTYPE stays as C as an output of locale.
This bug is very frustrating, since every single typo with an accented character key in my command line, followed by backspace is punished with a “command not found” error.
Just tried this – I’m using Manjaro Gnome with Gnome Terminal 3.44.1. It works fine on my system - typing the string of characters just gives me the output of the ls command - no errors or the like.
The link you shared was a wonderful trace, since that’s exactly what’s happening in my case: “a terminal (emulator) which understands multibyte encodings (UTF-8), but at the same time - the shell doesn’t”.
Unfortunately, I couldn’t resolve my issue with the solution proposed over there. My configs below:
$ cat /etc/X11/xorg.conf.d/00-keyboard.conf
# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "hr"
Option "XkbModel" "pc105"
EndSection
I still didn’t figure this out. As far as I understood, the conflict appears when either terminal emulator OR shell does not understand multibyte encodings of the other party.
I use the default Konsole + Yakuake (under the same profile) and all the profile settings seem right:
Settings > Edit the Current profile… > General > Environment > added LANG=hr_HR.UTF-8
Settings > Edit the Current profile… > Advanced > Default character encoding > selected UTF-8
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.
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:
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.
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.
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?
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
So:
the issue is as close to be resolved as it can get I recon …