siduck / st

snazzy terminal (suckless + beautiful)
MIT License
616 stars 95 forks source link

Control Backspace mapping #51

Closed orhnk closed 1 year ago

orhnk commented 1 year ago

Summary

When I press ctrl+backspace I expect the last word to get deleted but the last character gets.

Note: Generally these kind of issues relate to terminal emulator mappings.


I had the same issue when using kitty & alacritty.

map ctrl+backspace send_text all \x17
orhnk commented 1 year ago

Here are some info about st termkeys.

It turns out to be ctrl-alt-h deletes the previous word. Also I didn't realized that I can achieve the same thing using alt-backspace.

I just need to map a key for it

orhnk commented 1 year ago

Wasted time on finding the keybinding instead of trying the kitty's mapping.

Note I thought It was ^[^H or ^[^? as it was the result of showkey -a for ctrl + alr + h and alt + backspace which were deleting the whole word previously

I have added this to my configuration:

static Key key[] = {
  /*
      ...
  */
  /* keysym           mask            string      appkey appcursor */
  { XK_BackSpace,     ControlMask,    "\x17",          0,    0},
  /*
      ...
  */
}