Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binding to Ctrl+h not working #410

Closed
aoyama-val opened this issue Jul 11, 2023 · 5 comments · Fixed by #438
Closed

Binding to Ctrl+h not working #410

aoyama-val opened this issue Jul 11, 2023 · 5 comments · Fixed by #438

Comments

@aoyama-val
Copy link

I tried binding ctrl+h to a couple of functions, but in any case, it did not work; Nothing happened.

KeyBind:
    top:
        - "ctrl+h"

My terminal produces 0x08 on ctrl+h.

スクリーンショット 2023-07-11 16 32 06

$ ov --version
ov version 0.30.0 rev:ff0c648
@noborus
Copy link
Owner

noborus commented Jul 12, 2023

Thank you for your issue.
Some keys (ctrl+I, ctrl+M, ctrl+H...) cannot be received because they are converted by the terminal.
See gdamore/tcell#204.

@aoyama-val
Copy link
Author

Thanks for the response.
That makes sense, but even if so, can we somehow bind to Ctrl+h?

This worked. Both Tab and Ctrl+i jumped to the top.

    top:
        - "Tab"

This also worked. Enter and Ctrl+m.

    top:
        - "Enter"

But this did not.

    top:
        - "Backspace"
        - "Backspace2"
        - "Delete"

What Ctrl+h is same as?

@noborus
Copy link
Owner

noborus commented Jul 12, 2023

I see. Hmm. This may be cbind's backspace/backspace2 is not correct.

go mod vendor

edit vendor/code.rocketnine.space/tslocum/cbind/key.go

--- vendor/code.rocketnine.space/tslocum/cbind/key.go.old	2023-07-12 23:33:52.625548111 +0900
+++ vendor/code.rocketnine.space/tslocum/cbind/key.go	2023-07-12 23:33:56.325560055 +0900
@@ -25,10 +25,10 @@
 var UnifyEnterKeys = true
 
 var fullKeyNames = map[string]string{
-	"backspace2": "Backspace",
-	"pgup":       "PageUp",
-	"pgdn":       "PageDown",
-	"esc":        "Escape",
+	"backspace": "Backspace",
+	"pgup":      "PageUp",
+	"pgdn":      "PageDown",
+	"esc":       "Escape",
 }
 
 var ctrlKeys = map[rune]tcell.Key{
@@ -114,7 +114,7 @@
 		}
 		switch pieceLower {
 		case "backspace":
-			key = tcell.KeyBackspace2
+			key = tcell.KeyBackspace
 			continue
 		case "space", "spacebar":
 			key = tcell.KeyRune
make clean
make

Backspace can now be specified.

I will investigate further and contact cbind.

noborus added a commit to noborus/cbind that referenced this issue Sep 7, 2023
The actual key input ctrl+h can be set with the string "ctrl+h".
Fix for noborus/ov#410.
noborus added a commit that referenced this issue Sep 8, 2023
Temporarily replace the cbind module.
This resolves #410.
@noborus noborus reopened this Sep 11, 2023
@noborus
Copy link
Owner

noborus commented Sep 18, 2023

After trying various things, I decided to make ctrl+h the same as Backspace.
Also, ctrl+Backspace is the same.

ov has decided to deprecate the settings ctrl+h and Backspace2.
These behave differently depending on the terminal, causing confusion.

@noborus
Copy link
Owner

noborus commented Sep 23, 2023

Fixed in v0.32.0. thank you.

@noborus noborus closed this as completed Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants