bpython / curtsies

Curses-like terminal wrapper with a display based on compositing 2d arrays of text.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Home/End key is not recognised

pgy opened this issue · comments

Hi, on my machine curtsies fails to recognize the Home/End keys.

$ python3 -m curtsies.events                        
press a bunch of keys (not at the same time, but you can hit them pretty quickly)

---
b'\x1bOH'
unknown!!!
Unidentified character sequence!
type 'ok' to prove you're not pounding keys ok
Press the key that produced b'\x1bOH' again please
Describe in English what key you pressed: Home
Thanks! Please open an issue at https://github.com/thomasballinger/curtsies/issues
or email thomasballinger@gmail.com. Include this terminal history or keylog.txt.
You can keep pressing keys

---
b'\x1bOF'
unknown!!!
Unidentified character sequence!
type 'ok' to prove you're not pounding keys ok
Press the key that produced b'\x1bOF' again please
Describe in English what key you pressed: End
Thanks! Please open an issue at https://github.com/thomasballinger/curtsies/issues
or email thomasballinger@gmail.com. Include this terminal history or keylog.txt.
You can keep pressing keys

$ env | grep -i term
COLORTERM=xfce4-terminal
TERM=xterm

$ locale | cut -d= -f2 | uniq
en_US.UTF-8

just chiming in, OH is the "keypad" version of the home key (On today's laptops, the keypad is often indistinguishable). Here are the rest,

https://github.com/erikrose/blessings/blob/blessed-integration/blessings/keyboard.py#L323

Great thanks @jquast, if I do a small release before starting to use Blessed for this I'll included these.

thomasballinger@4150164 adds all keypad keys from @jquast's code.

I'd like to re-open this, as I still experience this exact issue, and I have been told that I'm already using the newest version (In the eyes of Debian, it's 0.2.6-1).

@BenWiederhake Thanks, I'll look into this soon.

Still having this problem, feels like it's been years I think:

'\x1bOH' is called Home
'\x1bOF' is called End

> pip show curtsies bpython
---
Name: curtsies
Version: 0.2.9

Name: bpython
Version: 0.15

:)

This is added, would anyone like to test?
pip install --upgrade git+git://github.com/thomasballinger/curtsies.git@213487e8e5b1594d0866e88ac4f43cf6ad45632d

If this fixes it things for anyone I'll release a version today.

Yeah, it worked for me!

Great! I just released a 0.2.10 with this fix in it, so everybody affected should run pip install --upgrade curtsies. If it doesn't fix things for you please let me know.

And while you're at it, maybe upgrade bpython, there's a new release today! There are some bug fixes and some tweaks to the layout the completion window, I'd love to hear what you think.