diff --git a/CHANGELOG.md b/CHANGELOG.md index c18a6ea..d33a181 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ CHANGELOG ``` - When you transform the input with `--with-nth`, the trailing white spaces are removed. +- `ctrl-\`, `ctrl-]`, `ctrl-^`, and `ctrl-/` can now be used with `--bind` - See https://github.com/junegunn/fzf/milestone/15?closed=1 for more details [argmax]: https://unix.stackexchange.com/questions/120642/what-defines-the-maximum-size-for-a-command-single-argument diff --git a/man/man1/fzf.1 b/man/man1/fzf.1 index 906fbe6..bd18fb8 100644 --- a/man/man1/fzf.1 +++ b/man/man1/fzf.1 @@ -521,6 +521,14 @@ e.g. .br \fIctrl-space\fR .br +\fIctrl-\\\fR +.br +\fIctrl-]\fR +.br +\fIctrl-^\fR (\fIctrl-6\fR) +.br +\fIctrl-/\fR (\fIctrl-_\fR) +.br \fIctrl-alt-[a-z]\fR .br \fIalt-[a-z]\fR diff --git a/src/options.go b/src/options.go index 848ce3d..fb432a6 100644 --- a/src/options.go +++ b/src/options.go @@ -417,6 +417,14 @@ func parseKeyChords(str string, message string) map[int]string { chord = tui.BSpace case "ctrl-space": chord = tui.CtrlSpace + case "ctrl-^", "ctrl-6": + chord = tui.CtrlCaret + case "ctrl-/", "ctrl-_": + chord = tui.CtrlSlash + case "ctrl-\\": + chord = tui.CtrlBackSlash + case "ctrl-]": + chord = tui.CtrlRightBracket case "change": chord = tui.Change case "alt-enter", "alt-return": diff --git a/src/tui/light.go b/src/tui/light.go index 43d7efe..d1020a9 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -345,6 +345,14 @@ func (r *LightRenderer) GetChar() Event { return Event{BSpace, 0, nil} case 0: return Event{CtrlSpace, 0, nil} + case 28: + return Event{CtrlBackSlash, 0, nil} + case 29: + return Event{CtrlRightBracket, 0, nil} + case 30: + return Event{CtrlCaret, 0, nil} + case 31: + return Event{CtrlSlash, 0, nil} case ESC: ev := r.escSequence(&sz) // Second chance diff --git a/src/tui/tcell.go b/src/tui/tcell.go index 098e8a1..4bd7c81 100644 --- a/src/tui/tcell.go +++ b/src/tui/tcell.go @@ -284,6 +284,12 @@ func (r *FullscreenRenderer) GetChar() Event { return Event{keyfn('z'), 0, nil} case tcell.KeyCtrlSpace: return Event{CtrlSpace, 0, nil} + case tcell.KeyCtrlBackslash: + return Event{CtrlBackSlash, 0, nil} + case tcell.KeyCtrlRightSq: + return Event{CtrlRightBracket, 0, nil} + case tcell.KeyCtrlUnderscore: + return Event{CtrlSlash, 0, nil} case tcell.KeyBackspace2: if alt { return Event{AltBS, 0, nil} diff --git a/src/tui/tui.go b/src/tui/tui.go index 9b82194..de1d4b5 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -40,6 +40,12 @@ const ( ESC CtrlSpace + // https://apple.stackexchange.com/questions/24261/how-do-i-send-c-that-is-control-slash-to-the-terminal + CtrlBackSlash + CtrlRightBracket + CtrlCaret + CtrlSlash + Invalid Resize Mouse