This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Can't type ~ into the terminal

Tags: None
(comma "," separated)
vsjoqvist
Registered Member
Posts
10
Karma
0

Can't type ~ into the terminal

Wed Jun 22, 2022 11:44 am
A couple of days ago i stopped being able to type '~' in konsole (after some texxting I have the same problem in kitty but it works in xterm and alacritty). Im using Arch linux so when it suddenly stopped I figured it was because of a system updated, so i went ahead and downgraded konsole to an older release, but the problem persisted.

I had a similar problem when I first installed arch because my locales were set up incorrectly, installing the locales correctly fixed the problem but I haven't touched the locales in months so that is probably not the issue either. However running konsole with 'LC_ALL=C' lets me type '~' into the terminal so it might actually be a problem with the locales. When I first had this issue the local command "locale" gave me error messages but it doesn't now.

I'm using this (https://github.com/vsjoqvist/en_SE) this custom locale if it matters, but as I said, it used to work fine.

I got recommend to try and look for the problem in my konsole locale settings because maybe that would change how the keyboard would interact with konsole. It didn't fix it, but two interesting things happened. Pressing the defaults button sets my primary language to Albanian, but im in Sweden and have no system settings that would indicate hat im even near Albania. The other interesting thing is that when I add Swedish as a fallback language konsole stays in English (which it should because English is the primary language) but most of my application start to use Swedish (including vim, pacman, git etc).

When i press and hold altgr + ¨ the cursor stoops blinking, so konsole is definitely noticing the key press, but its not sending it to the terminal for some reason.

I've also tried different shells and the result is the same.

Does anyone know how I would be able to fix this?
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: Can't type ~ into the terminal

Wed Jun 22, 2022 3:49 pm
vsjoqvist wrote:Im using Arch linux … because my locales were set up incorrectly…

Do you really use Arch? Or some "based on"-distribution? In Arch you have to explicit setup your locales and needed locales, like en_GB in your custom file and sudo is not preinstalled (or preconfigured).
If you use another distribution than Arch check how the locales got set up during installation, including /etc/vconsole.conf, /etc/default/…, etc. Depending on the distribution other files are used.

What keyboard layout did you set globally? Check
Code: Select all
env | grep -E 'LANG|LAYO|^LC_|^TERM'
localectl
grep -Ev '^[[:space:]]*([#;]|$)' /etc/locale.gen

…Pressing the defaults button sets my primary language to Albanian…

Could be the first entry in list which would be a fallback. Again it depends on how the locales are set up in the system, in this case this would be the language in /etc/locale.conf.

And it all can depend on the keyboard layout. ~ is in different locations on different layouts. In the default us layout it is left from the number key 1 on the second level (simple shift). You can use `tastenbrett` to display your layout which is the application showing the layout in the systemsettings.
vsjoqvist
Registered Member
Posts
10
Karma
0

Re: Can't type ~ into the terminal

Wed Jun 22, 2022 5:26 pm
koffeinfriedhof wrote:
vsjoqvist wrote:Im using Arch linux … because my locales were set up incorrectly…

Do you really use Arch? Or some "based on"-distribution? In Arch you have to explicit setup your locales and needed locales, like en_GB in your custom file and sudo is not preinstalled (or preconfigured).
If you use another distribution than Arch check how the locales got set up during installation, including /etc/vconsole.conf, /etc/default/…, etc. Depending on the distribution other files are used.

What keyboard layout did you set globally? Check
Code: Select all
env | grep -E 'LANG|LAYO|^LC_|^TERM'
localectl
grep -Ev '^[[:space:]]*([#;]|$)' /etc/locale.gen

…Pressing the defaults button sets my primary language to Albanian…

Could be the first entry in list which would be a fallback. Again it depends on how the locales are set up in the system, in this case this would be the language in /etc/locale.conf.

And it all can depend on the keyboard layout. ~ is in different locations on different layouts. In the default us layout it is left from the number key 1 on the second level (simple shift). You can use `tastenbrett` to display your layout which is the application showing the layout in the systemsettings.


I'm using vanilla arch and my locales are set up like shown of in the installation guide, I've double checked everything and I didn't find anything that wasn't set up correctly, /etc/locale.conf is exporting LANG as en_SV which is the same locale that is active in /etc/locale.gen.

tastenbrett shows the correct keyboard layout and i can type ~ in all other applications so thats is not too surprising.

Running the command you gave me printed this output
Code: Select all
localectl
grep -Ev '^[[:space:]]*([#;]|$)' /etc/locale.gen
LANGUAGE=en_US
LC_MONETARY=en_SE.UTF-8
LANG=en_SE.UTF-8
TERM=xterm-256color
LC_MEASUREMENT=en_SE.UTF-8
LC_TIME=en_SE.UTF-8
LC_NUMERIC=en_SE.UTF-8
   System Locale: LANG=en_SE.UTF-8
       VC Keymap: sv-latin1
      X11 Layout: n/a
en_SE.UTF-8 UTF-8


This looks correct to me, im assuming that LANGUAGE is set by kde since that is what I have in my system settings. Looks like I don't have a x11 layout set so I'll try to set one.

Also, Albanian is at the top of the list in konsoles languages list so that is probably why it is the defualt.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: Can't type ~ into the terminal

Wed Jun 22, 2022 7:13 pm
Great!

Did you set en_SV.UTF-8 in /etc/vconsole.conf too? (That is the part working in other ttys, e.g. by pressing Ctrl-Alt-F3). This could need the TERM variable too, if it does not work. But you can use `loadkeys se-lat6` or other variants. But this is independent of your current problem).

Back to the graphical terminal emulator. You can set your layout using
Code: Select all
localectl set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]
# e.g. swedish(us) on a european keyboard
localectl set-x11-keymap se pc105 us

This should trigger PolKit to ask for your root-password and sets it globally.

Then check your graphical terminal again.
vsjoqvist
Registered Member
Posts
10
Karma
0

Re: Can't type ~ into the terminal

Thu Jun 23, 2022 5:35 pm
koffeinfriedhof wrote:Great!

Did you set en_SV.UTF-8 in /etc/vconsole.conf too? (That is the part working in other ttys, e.g. by pressing Ctrl-Alt-F3). This could need the TERM variable too, if it does not work. But you can use `loadkeys se-lat6` or other variants. But this is independent of your current problem).

Back to the graphical terminal emulator. You can set your layout using
Code: Select all
localectl set-x11-keymap LAYOUT [MODEL [VARIANT [OPTIONS]]]
# e.g. swedish(us) on a european keyboard
localectl set-x11-keymap se pc105 us

This should trigger PolKit to ask for your root-password and sets it globally.

Then check your graphical terminal again.


sv-latin1 is set is /etc/vconsole.conf which i believe should be correct. Unfortunately it doesn't look like setting the x11 keymap fixed it, I've tried rebooting since setting it but that didnt help. Anymore ideas on what might be causing it?
vsjoqvist
Registered Member
Posts
10
Karma
0

Re: Can't type ~ into the terminal

Thu Jun 23, 2022 5:45 pm
I just tried it in wayland to see if it made a differnce but it has the same problem
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: Can't type ~ into the terminal

Thu Jun 23, 2022 7:01 pm
sv-latin1 is fine too. It just has to work. I remember having an issue with unlocking a luks container on boot with a custom keymap, thats why I asked. Could have been a hidden hint ;)

I would add en_GB.UTF-8 to your locales as you rely on it in your custom file. I asked for it but forgot to comment. So that would be the first to do.

In case of checking errors, first thing I always look at is `journalctl -b -p err` for all errors since last boot. You may replace err with warning to get warnings too. The "new dmesg" is `journalctl -k` which shows all kernel messages.

Keyboard on XServer check is changing the layout on the fly using `setxkbmap us` and back.

Further checking can be done by running `evtest` (needs root permission). Check which key press is detected in this environment. Do you have a special keyboard? I know some Acer models have a very bad i8042 (keyboard controller) implementation that causes issues from time to time. But those are more like "keyboard suddenly stopped working".

Konsole: Try changing the keyboard setting in edit current profile → keyboard to linux or xfree.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: Can't type ~ into the terminal

Fri Jun 24, 2022 9:46 am
I added your en_SE locale, activated it via localectl globally and via systemsettings for my user. Everything worked as expected, including the us-intl-with-altgr-dead-key layout. I tried with disabling en_GB 8859-1 which made no difference. So I think the missing keyboard key must be some keyboard layout/mapping issue.

Did you change anything like /usr/share/X11/xkb/rules/evdev? This would be reset on upgrades and there were some keyboard upgrades a few days ago.
vsjoqvist
Registered Member
Posts
10
Karma
0

Re: Can't type ~ into the terminal

Fri Jun 24, 2022 6:14 pm
koffeinfriedhof wrote:sv-latin1 is fine too. It just has to work. I remember having an issue with unlocking a luks container on boot with a custom keymap, thats why I asked. Could have been a hidden hint ;)

I would add en_GB.UTF-8 to your locales as you rely on it in your custom file. I asked for it but forgot to comment. So that would be the first to do.

In case of checking errors, first thing I always look at is `journalctl -b -p err` for all errors since last boot. You may replace err with warning to get warnings too. The "new dmesg" is `journalctl -k` which shows all kernel messages.

Keyboard on XServer check is changing the layout on the fly using `setxkbmap us` and back.

Further checking can be done by running `evtest` (needs root permission). Check which key press is detected in this environment. Do you have a special keyboard? I know some Acer models have a very bad i8042 (keyboard controller) implementation that causes issues from time to time. But those are more like "keyboard suddenly stopped working".

Konsole: Try changing the keyboard setting in edit current profile → keyboard to linux or xfree.


this looks like it could be the problem
Code: Select all
 Jun 24 20:09:37 arch kwin_x11[697]: kwin_xkbcommon: XKB: couldn't find a Compose file for locale "en_SE.UTF-8" (mapped to "en_SE.UTF-8")
 
vsjoqvist
Registered Member
Posts
10
Karma
0

Re: Can't type ~ into the terminal

Fri Jun 24, 2022 6:15 pm
koffeinfriedhof wrote:I added your en_SE locale, activated it via localectl globally and via systemsettings for my user. Everything worked as expected, including the us-intl-with-altgr-dead-key layout. I tried with disabling en_GB 8859-1 which made no difference. So I think the missing keyboard key must be some keyboard layout/mapping issue.

Did you change anything like /usr/share/X11/xkb/rules/evdev? This would be reset on upgrades and there were some keyboard upgrades a few days ago.


Nope, i've never touched /usr/share/X11/xkb/rules/evdev
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: Can't type ~ into the terminal

Fri Jun 24, 2022 8:28 pm
vsjoqvist wrote:
Code: Select all
 Jun 24 20:09:37 arch kwin_x11[697]: kwin_xkbcommon: XKB: couldn't find a Compose file for locale "en_SE.UTF-8" (mapped to "en_SE.UTF-8")
 

Thats the only thing? I now that Plasma uses such files. You can try create /usr/share/locale/en_SE/kf5_entry.desktop with the content
Code: Select all
[KCM Locale]
Name=Swedish English or whatever

If that's the compose file mentioned. Or did you enable a compose key in the keyboard layout advanced settings? There is also KWIN_COMPOSE as an environment variable for the graphics stuff, but I think this won't break a keyboard layout. I'll check the source for the error.

I tried to change my system to your settings, but it didn't break. So it is hard to find out what the problem is without sitting in front or getting all file contents. Can you try creating a fresh new user, set it up with en_SE as your primary account and test if it occurs there too?

// edit: This was just a warning I think? Kwin irritated me but the warning (if one) is a XKB warning as it didn't find a file in /usr/share/X11/locale. Never did it but you can try edit /usr/share/X11/locale/compose.dir and insert your locale.
vsjoqvist
Registered Member
Posts
10
Karma
0

Re: Can't type ~ into the terminal

Sat Jun 25, 2022 10:28 pm
koffeinfriedhof wrote:
vsjoqvist wrote:
Code: Select all
 Jun 24 20:09:37 arch kwin_x11[697]: kwin_xkbcommon: XKB: couldn't find a Compose file for locale "en_SE.UTF-8" (mapped to "en_SE.UTF-8")
 

Thats the only thing? I now that Plasma uses such files. You can try create /usr/share/locale/en_SE/kf5_entry.desktop with the content
Code: Select all
[KCM Locale]
Name=Swedish English or whatever

If that's the compose file mentioned. Or did you enable a compose key in the keyboard layout advanced settings? There is also KWIN_COMPOSE as an environment variable for the graphics stuff, but I think this won't break a keyboard layout. I'll check the source for the error.

I tried to change my system to your settings, but it didn't break. So it is hard to find out what the problem is without sitting in front or getting all file contents. Can you try creating a fresh new user, set it up with en_SE as your primary account and test if it occurs there too?

// edit: This was just a warning I think? Kwin irritated me but the warning (if one) is a XKB warning as it didn't find a file in /usr/share/X11/locale. Never did it but you can try edit /usr/share/X11/locale/compose.dir and insert your locale.


The kwin message was an error. Also i don't understand how i add my locale to /usr/share/X11/locale/compose.dir because i do not know how it works, and what the different words in it are referring to.
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: Can't type ~ into the terminal

Sun Jun 26, 2022 10:54 am
Now we got a bunch of stuff to do ;) But lets stay to the keyboard layout first.
I've setup a new, fresh user and did the following changes:
- settings - regional settings - region: en_SE.utf-8
- settings - input - keyboard:
+ chosen geometry (as I have a modern restricted keyboard, another story)
+ actviated "configure layout" and chose US, intl., AltGr Unicode combining as I don't want dead keys on ~, `, etc.
- applied everything, relogin

Now I get the following from
Code: Select all
grep -Ev '^$|^#' /etc/{locale,vconsole}.conf
cat ~/.config/{kxkbrc,plasma-localerc}


Code: Select all
/etc/locale.conf:LANG="en_US.UTF-8"
/etc/vconsole.conf:TERM=ter-v32n
/etc/vconsole.conf:KEYMAP=ck9310
[$Version]
update_info=kxkb.upd:remove-empty-lists,kxkb.upd:add-back-resetoptions,kxkb_variants.upd:split-variants

[Layout]
LayoutList=us
Model=dell9310
Use=true
VariantList=intl-unicode
[Formats]
LANG=en_SE.UTF-8


Everything seems to work. No problems typing ~ or any other keys defined in the above layout.
vsjoqvist
Registered Member
Posts
10
Karma
0

Re: Can't type ~ into the terminal

Thu Jun 30, 2022 11:30 am
Im sorry for the late reply, I haven't had access to the computer in the last couple of days.

I get the same errors on all users where i set the keyboard to swedish. I've also noticed that not just konsole is unable to pickup ~, all kde apps seems to have that issue, none of the kde apps on my system seems to be able to detect it, so it might be an issue with how they collect their input. However whenever i type ~ in them the cursor stops pulsing as if i were typing, which I find weird
koffeinfriedhof
Registered Member
Posts
608
Karma
4
OS

Re: Can't type ~ into the terminal

Thu Jun 30, 2022 4:44 pm
I'm very patient with other peoples problems :D

Did you try pressing ~ and then space in case you activated the dead key stuff? (Sorry, but sometimes the simple things are an idea).

Besides my custom geometry and keyboard layout, did you notice differences between my output and yours? I need more input ;)


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]