csi and modifyotherkeys ctrl-backspace input handing
Author: mckellygitCreated Sep 23, 2026Updated Sep 23, 2026
Checklist
- I have read through the manual page (
man fzf) - I have searched through the existing issues
- For bug reports, I have checked if the bug is reproducible in the latest version of fzf
Output of fzf --version
0.74.4 (961793cf)
OS
- Linux
- macOS
- Windows
Shell
- bash
- zsh
- fish
- nushell
- PowerShell
Problem / Steps to reproduce
Hi,
Thank you for fzf, I use it so much each day.
Either \x1b[127;5u or \x1b[27;5;127~
do not seem to trigger the ctrl-backspace binding for me.
An assisted code attempt seems to work:
My branch of this fix: https://github.com/mckellygit/fzf/tree/ctrl_bs
diff --git src/tui/light.go src/tui/light.go
index 4f5ec4d5..14e71d73 100644
--- src/tui/light.go
+++ src/tui/light.go
@@ -542,6 +542,29 @@ func (r *LightRenderer) escSequence(sz *int) Event {
return Event{Invalid, 0, nil}
}
+ // Ctrl-Backspace:
+ // CSI 127;5u - CSI-u / Kitty keyboard encoding
+ // CSI 27;5;127~ - xterm modifyOtherKeys encoding
+ ctrlBackspaceSequences := [][]byte{
+ []byte("\x1b[127;5u"),
+ []byte("\x1b[27;5;127~"),
+ }
+
+ for _, sequence := range ctrlBackspaceSequences {
+ if len(r.buffer) >= len(sequence) &&
+ bytes.Equal(r.buffer[:len(sequence)], sequence) {
+ *sz = len(sequence)
+ return Event{CtrlBackspace, 0, nil}
+ }
+
+ // The input reader may not have received the whole sequence yet.
+ // Return Invalid without consuming ESC so GetChar can retry.
+ if len(r.buffer) < len(sequence) &&
+ bytes.Equal(r.buffer, sequence[:len(r.buffer)]) {
+ return Event{Invalid, 0, nil}
+ }
+ }
+thx, -m
How did you run into this?
My terminal outputs this csi esq sequence for ctrl-backspace and fzf query editing doesn't handle it as backspace or ctrl-backspace, but just echos these chars.
Source: junegunn/fzf