You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Arrow keys does not work in linux framebuffer #2309
When I press an arrow key in linux framebuffer (Ctrl+Alt+F2), something like OA and OD will show up and it does not return to the previous command, left and right keys does not work too.
I want to use arrow keys, does anyone know how to fix that?
uname -a:
Linux alarmpi 4.1.5-1-ARCH #1 SMP PREEMPT Wed Aug 12 19:02:34 MDT 2015 armv7l GNU/Linux
You're running archlinux arm, aren't you? In that case you probably have systemd, so the output of localectl (specifically the "VC Keymap") would be useful. If you haven't set it, you should probably create a /etc/vconsole.conf (or use localectl to do it for you - note to self: add completion for localectl). See the archwiki article.
That's weird. Does it also have issues with other vc keymaps (after reboot, of course)? I'm guessing "unicode" is a fallback-thing. Why not choose the country-code of your keyboard layout?
So, according to sheldon in #2330, it seems like, in bash, pressing ctrl-v and then a key will print its character sequence (we should get that function as well). Please try that with the affected keys.
Thanks. I'd rather not balloon all our key bindings with all escape codes for all terminals, so I'd appreciate a solution where we can just execute something like tput smkx when needed (or at least not harmful). How do we detect that it's needed? Can it be harmful (i.e. make some keys not work)?
BTW: Does this improve the original situation with the VT - if you build without a21e44c and instead execute tput smkx do the arrows output more normal codes?
BTW: Does this improve the original situation with the VT - if you build without a21e44c and instead execute tput smkx do the arrows output more normal codes?
No, it just display the same weird codes.
Thanks. I'd rather not balloon all our key bindings with all escape codes for all terminals (and I dislike that "st" behaves this way when nearly everything else seems to work better), so I'd appreciate a solution where we can just execute something like tput smkx when needed (or at least not harmful). How do we detect that it's needed? Can it be harmful (i.e. make some keys not work)?
I thought you said that there is some terminal specific ...?
I thought you said that there is some terminal specific ...?
Yes, there are some terminal-specific codes in our bindings, but I don't really like adding too many more. Of course we could make it more palatable by grouping things like
for k in\eOC \e\[C # right-arrowbind$argv$k forward-char
end
(and I might end up doing that anyway)
If it was only delete and only in st and then we'd be done I'd just add it, but I expect it to be more, even in st - what about shift-delete?
Ideally terminfo would just have that info so we get it via bind -k - this would also improve the situation for users who create their own bindings and switch terminals. Detecting the terminal and then doing tput smkx (which really seems like a magic "do the right thing and not your stupid default" command to me) would also solve this, but I have no clue how to do that - "$TERM" is not going to help since everyone sets that to "xterm-256color" because too many programs expect it to be.
If it was only delete and only in st and then we'd be done I'd just add it, but I expect it to be more, even in st - what about shift-delete?
What is shift-delete for?
Ideally terminfo would just have that info so we get it via bind -k - this would also improve the situation for users who create their own bindings and switch terminals. Detecting the terminal and then doing tput smkx (which really seems like a magic "do the right thing and not your stupid default" command to me) would also solve this, but I have no clue how to do that - "$TERM" is not going to help since everyone sets that to "xterm-256color" because too many programs expect it to be.
Yeah, there is terminfo for st. By default, st uses st-256color and I uses that anyway as it did not broke anything.
I haven't tried shift-delete, ctrl-delete, insert, ctrl-insert, shift-up, ctrl-up as I never uses them, the most visible is delete. Maybe I could patch st for delete to work.
all of these seem to be fixed via tput smkx, and $TERM is set to "st-256color".
Activity
faho commentedon Aug 17, 2015
What's your keymap (in /etc/vconsole.conf)?
pickfire commentedon Aug 17, 2015
I cannot find
/etc/vconsole.conf.faho commentedon Aug 17, 2015
You're running archlinux arm, aren't you? In that case you probably have systemd, so the output of
localectl(specifically the "VC Keymap") would be useful. If you haven't set it, you should probably create a /etc/vconsole.conf (or use localectl to do it for you - note to self: add completion for localectl). See the archwiki article.faho commentedon Aug 17, 2015
I've added localectl completions in cb5d36d, so you should have an easier time with setting the keymap.
pickfire commentedon Aug 17, 2015
localectl set-locale <TAB>still does not work. How do I use tab completion for that?pickfire commentedon Aug 17, 2015
I have set
VC Keymaptounicode. It still doesn't work even if it is set toukorus.faho commentedon Aug 17, 2015
Well, you'd need to get the completion script from current git HEAD and drop it in ~/.config/fish/completions.
pickfire commentedon Aug 17, 2015
Well now my
localectlshows:It still doesn't work in framebuffer.
faho commentedon Aug 17, 2015
Please reboot your system - if I don't after changing keymaps, I also have some keys not working.
pickfire commentedon Aug 17, 2015
It still has the same problem after reboot.
faho commentedon Aug 17, 2015
That's weird. Does it also have issues with other vc keymaps (after reboot, of course)? I'm guessing "unicode" is a fallback-thing. Why not choose the country-code of your keyboard layout?
pickfire commentedon Aug 18, 2015
It still have the same result after reboot even after I set localectl to:
faho commentedon Aug 30, 2015
So, according to sheldon in #2330, it seems like, in bash, pressing ctrl-v and then a key will print its character sequence (we should get that function as well). Please try that with the affected keys.
pickfire commentedon Aug 31, 2015
Using
bashin framebuffer:faho commentedon Aug 31, 2015
Then try the following:
or
(Add it to the fish_user_key_bindings function if you want to have it in config)
This is kinda weird since these for me send "^[[A", "^[[B" and so on (in a VT of course).
17 remaining items
pickfire commentedon Sep 1, 2015
Every one of the following fixed it:
But I think that we shouldn't only use
fish-specific command.I doesn't know why, but it seems that I can't press
kin bash. Only^v kworks and it showskonly.pickfire commentedon Sep 1, 2015
In bash, it shows
^[[3~. And delete works by default in zsh.pickfire commentedon Sep 1, 2015
I have updated the last two coment.
It seems that after I run zsh and close it. fish seems to have delete work.
faho commentedon Sep 1, 2015
Thanks. I'd rather not balloon all our key bindings with all escape codes for all terminals, so I'd appreciate a solution where we can just execute something like
tput smkxwhen needed (or at least not harmful). How do we detect that it's needed? Can it be harmful (i.e. make some keys not work)?BTW: Does this improve the original situation with the VT - if you build without a21e44c and instead execute
tput smkxdo the arrows output more normal codes?pickfire commentedon Sep 1, 2015
No, it just display the same weird codes.
I thought you said that there is some terminal specific ...?
faho commentedon Sep 1, 2015
Yes, there are some terminal-specific codes in our bindings, but I don't really like adding too many more. Of course we could make it more palatable by grouping things like
(and I might end up doing that anyway)
If it was only delete and only in st and then we'd be done I'd just add it, but I expect it to be more, even in st - what about shift-delete?
Ideally terminfo would just have that info so we get it via
bind -k- this would also improve the situation for users who create their own bindings and switch terminals. Detecting the terminal and then doingtput smkx(which really seems like a magic "do the right thing and not your stupid default" command to me) would also solve this, but I have no clue how to do that - "$TERM" is not going to help since everyone sets that to "xterm-256color" because too many programs expect it to be.faho commentedon Sep 1, 2015
I've just installed st, and here's a list of key combinations that don't work and what they print:
all of these seem to be fixed (i.e. set to standard codes) via
tput smkx, and $TERM is set to "st-256color".pickfire commentedon Sep 1, 2015
I understand what you mean, bind everything...
What is shift-delete for?
Yeah, there is terminfo for st. By default, st uses
st-256colorand I uses that anyway as it did not broke anything.I haven't tried shift-delete, ctrl-delete, insert, ctrl-insert, shift-up, ctrl-up as I never uses them, the most visible is delete. Maybe I could patch st for delete to work.
What about
printf '\033[?1h\033=' >/dev/tty?faho commentedon Sep 1, 2015
Currently nothing - the point though is that this outputs something different in st than elsewhere.
But it gives info for the smkx mode:
It seems like st expects everyone to send it that - now it'd be nice to know why.
Same thing, except the former uses the terminfo database. st has
smkx=\E[?1h\E=.@zanchey: You seem to know your way around this stuff. Anything we can do? Anything I got wrong?
pickfire commentedon Sep 1, 2015
Should I ask in the mailing list about it?
faho commentedon Sep 1, 2015
Let's check the archives first.
faho commentedon Sep 1, 2015
Why not discuss this in #2139, actually? You opened it to track this, after all.
pickfire commentedon Sep 1, 2015
Sorry, I forgot about that. The case for linux framebuffer is solved.
Add escape sequences for arrows in some linux VTs