ITADN

Ctrl+H is incorrectly recognized as Backspace

#2490Closedlokalius 创建于 2026-04-06
L
lokaliuscommented
Related issue: [#767](https://github.com/gokcehan/lf/issues/767). When trying to map `Ctrl+H` to toggle hidden files in `lf`: `map <c-h> :set hidden!`, I get the error: `unknown mapping: <backspace>`. I suspect `lf` is confusing `Ctrl+H` with `Backspace`, just as the issue [#767](https://github.com/gokcehan/lf/issues/767). I used `showkey -a` in my terminal `Rio` to capture the actual characters sent by `Ctrl+H` and `Backspace`: ``` ^? 127 0177 0x7f (Backspace) ^H 8 0010 0x08 (Ctrl+H) ``` The same result is obtained in `Kitty` terminal. This confirms that the terminal correctly distinguishes between the two keys. `^H` (ASCII 8) and `^?` (ASCII 127) have both been used historically as “backspace/delete”. Whether `Kitty`, `Alacritty`, or `Rio`, when used *directly*, `Ctrl+H` indeed behaves like the `Backspace` key. > For example, typing `env` followed by `Ctrl+H` results in `en`. Since the terminal sends different key codes, the issue is likely inside `lf`’s input handling layer. Thank you. > I am not very familiar with character processing in terminals, and the above are all my inferences. Therefore, if there are any errors, please correct them directly.
关闭于 2026-04-07 2 条评论