vonshednob / pter

Manage your todo.txt in a commandline user interface (TUI)
https://vonshednob.cc/pter/
MIT License
104 stars 6 forks source link

Home key in task editor closes editor instead of going to start of line #2

Closed danielk333 closed 3 years ago

danielk333 commented 3 years ago

xev output for home key:

KeyPress event, serial 32, synthetic NO, window 0x5800001,
    root 0x25b, subw 0x0, time 259392470, (-166,400), root:(2718,475),
    state 0x10, keycode 110 (keysym 0xff50, Home), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 32, synthetic NO, window 0x5800001,
    root 0x25b, subw 0x0, time 259392550, (-166,400), root:(2718,475),
    state 0x10, keycode 110 (keysym 0xff50, Home), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False
vonshednob commented 3 years ago

I can't reproduce this issue; could you please check with a minimal python program like the one below what your terminal is making of the Home key?

#!/usr/bin/env python
import curses

savedexc = None
result = None

try:
    scr = curses.initscr()
    curses.noecho()
    curses.cbreak()
    scr.keypad(True)

    result = scr.get_wch()

except Exception as exc:
    savedexc = exc

try:
    curses.endwin()
except:
    pass

print(f"Key was: {result}")

if savedexc is not None:
    raise savedexc
danielk333 commented 3 years ago

Hmmmm, this is strange.

When pressing Home i get

[basic] danielk@danielk-GE62-6QD:PYTHON$ python ncurses_key_test.py
Key was:

For the End key I get:

[basic] danielk@danielk-GE62-6QD:PYTHON$ python ncurses_key_test.py
Key was: 385
vonshednob commented 3 years ago

Any chance you can try this with a different terminal? Or inside/outside tmux?

danielk333 commented 3 years ago

Wow, in uxrvt i got 262 for Home and 360 for End....

vonshednob commented 3 years ago

So, st is a problem then? How is tmux doing?

danielk333 commented 3 years ago

Assuming its my old strange distro+corsair keyboard that causes it