vonshednob / pter

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

standard keybinding can't be parsed #33

Closed andrei-a-papou closed 6 months ago

andrei-a-papou commented 6 months ago

Hello and thank you for creating pter. I've been looking for a full-fledged keyboard-driven todo.txt app and recently stumbled upon this app I've read through the docs and it looks very promising!

I'm on a Linux box that runs Python 3.9, so I had to dockerize pter to run it. I'll use GitHub to report any issues or feature requests, I hope that's OK -- I don't have a codeberg account.

Right now I'm customizing keyboard shortcuts (by editing example.conf) and there's a small issue: uncommenting : = jump-to makes pter crash with the following error message:

Traceback (most recent call last):
  File "/opt/pter/bin/pter", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/opt/pter/lib/python3.11/site-packages/pter/main.py", line 91, in run
    config = configuration.get_config(args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/pter/lib/python3.11/site-packages/pter/configuration.py", line 196, in get_config
    conf.read([conffile])
  File "/usr/lib/python3.11/configparser.py", line 713, in read
    self._read(fp, filename)
  File "/usr/lib/python3.11/configparser.py", line 1132, in _read
    raise e
configparser.ParsingError: Source contains parsing errors: PosixPath('/home/developer/.config/pter/pter.conf')
        [line 180]: ': = jump-to\n'

I tried specifying <:> = jump-to and it seems to work fine.

vonshednob commented 6 months ago

Thanks for giving pter a spin! I hope it can improve your life :grin:

Raising issues here is perfectly fine; I don’t want to force people to create accounts everywhere just to report problems or ask questions.

Regarding the parsing error -- now that I read the line, it makes a lot of sense that pter doesn’t like it. I’ll fix the example.conf.

Thanks a lot for bringing it up!

andrei-a-papou commented 6 months ago

Thanks for giving pter a spin! I hope it can improve your life

It already has, thank you!

I tried specifying <:> = jump-to and it seems to work fine.

Actually, I've just enabled debug logging and, say, with <:> = nop line in the pter.conf pter complains about an invalid shortcut: [WARNING] Cannot bind < to '> = nop': no such function.

Is there a way to unset the : shortcut? What would be the proper syntax in pter.conf? I tried various escape patterns (\:, \\:, ::, ":", ':'), but to no avail.

vonshednob commented 6 months ago

That sounds like a bug to me. I’ll investigate!

vonshednob commented 6 months ago

Yeah, that was a "feature" of the configuration file format. There are fixes in 3.15.0.

Just so you don’t have to rummage through the documentation: :, =, and ; are special in the configuration file format. To use them they have to be escaped somehow. I introduced <colon>, <equal>, and <semicolon> so these keys can be used in shortcuts now.

Let me know if there’s more stuff wrong with it!

andrei-a-papou commented 6 months ago

I've tested <colon> and it works fine. thank you!