Add Support for ctrl+h
Ctrl+h is a convenient shortcut inside of the terminal so you don't have to reach for the backspace key. I use it everywhere, however taskell does not appear to support it.
It sends the ^H signal (0x08) instead of the ^? (0x7f) many terminals use for backspace nowadays
Hadn't come across that. Sounds useful.
Supporting modifier keys is a bit tricky. Apparently the signals are not terribly consistent between terminal emulators. I don't actually have much control over it as it relies on the library I'm using. I've not had much success when I've tried previously.
I'll give it another go at some point – it's possible that a more recent version of the code makes it easier. I'd certainly like to be able to support modifier keys.
I don't even know if supporting modifiers would be necessary. It could potentially work by just supporting the different keycode in the terminal. ^H is typically the delete keycode (not the one sent by the delete key which is different). I don't know the exact historical reasoning but typically in modern terminals it is also sent with a modifier + backspace.
What is the library you're using? No modifiers seems like a weird oversight
It's not that it doesn't support modifiers, just that they're not very reliable. I think I remember reading that this is to do with inconsistencies between terminal emulators (although it was a few years ago).
Hmm, just tried ctrl+h in Taskell and it worked without me having to do anything.
What terminal are you using? I tried it in st, alacritty and termite.
Can you also maybe check the output of showkey -a?
I looked a bit through your and the brick source code and both in your code and the brick source code you seem to be using the EvKey KBS which is defined here
However, this is about as far as I can get with my knowledge of haskell. I don't know where I could look at the implementation of this. Basically the reason why I am looking here is in case the issue might be higher up stream. Though I don't know any other projects that use this or the inbuilt editor thingy from brick to check if it's a general issue.
Though this actually made me consider that potentially we should turn this issue into one about general support for shell/readline bindings? All those handy bindings (or at least the most important ones) like ctrl+w, ctrl+u, ctrl+a, ctrl+e etc. I actually keep hitting ctrl+a already to try and jump to the beginning of the text input in order to add something to the beginning of a Task.
I was using Terminal on macOS. showkey doesn't seem to be a thing on macOS.
As I say, Brick supports modifier keys, they're just not consistent between platforms, so it's not very useful.
Hm, weird. Is there another way to check keycodes on mac os?
Hm, weird. Is there another way to check keycodes on mac os?
Maybe this can help?
May I hijack this conversation to also request support for the suspend signal (Ctrl-Z)? Or should I open a ticket?
PS. Began using Taskell today, great app @smallhadroncollider 👏🏻 👏🏻 👏🏻
@bjacquet A separate ticket please 😃