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

Some characters are missing when pasted to search prompt with Cmd v #613

Closed
aoyama-val opened this issue Aug 27, 2024 · 7 comments · Fixed by #616
Closed

Some characters are missing when pasted to search prompt with Cmd v #613

aoyama-val opened this issue Aug 27, 2024 · 7 comments · Fixed by #616
Labels
help wanted Extra attention is needed

Comments

@aoyama-val
Copy link

  • macOS Sonoma 14.6.1
  • iTerm2 or Terminal.app
  • ov 0.36.0 rev:d671c94

Although the content of the clipboard is 57f5dd59-7158-495b-82d0-94ba9dc4bc9c, the pasted text becomes 58-495b-82d0-94ba9dc4bc9c. The leading part is missing. I'm not sure if the missing part is always the leading one. When the buffer is large (90KB) this seems to occur. The issue is only with Cmd v, and Ctrl v (ov's paste function) seems working perfectly.

@noborus
Copy link
Owner

noborus commented Aug 27, 2024

Thank you.

Is this a problem related to "Bracketed Paste"?
https://github.com/gdamore/tcell?tab=readme-ov-file#bracketed-paste

Does it work differently if I run EnablePage() first?

diff --git a/oviewer/oviewer.go b/oviewer/oviewer.go
index c079cec..d601654 100644
--- a/oviewer/oviewer.go
    b/oviewer/oviewer.go
@@ -686,6  686,7 @@ func (root *Root) prepareRun(ctx context.Context) error {
 	if !root.Config.DisableMouse {
 		root.Screen.EnableMouse(MouseFlags)
 	}
 	root.Screen.EnablePaste()
 
 	root.setCaption()
 

@aoyama-val
Copy link
Author

I also suspected bracketd paste, but disabling it in iTerm2 didn't change anything. In Terminal.app, I could not even find the setting. The issue was also reproduced in kitty and WezTerm.

By the patch, paste became slower, but the result was the same.

There was a case in which the middle part was lost. c6c0796d-4a67-40f5-8e47-eed8454200c2 became c7-40f5-8e47-eed8454200c2

@noborus
Copy link
Owner

noborus commented Aug 30, 2024

Ummm. I don't know where the cause is yet.

@noborus noborus added the help wanted Extra attention is needed label Aug 30, 2024
@aoyama-val
Copy link
Author

Disabled incremental search and it is working well.

Incsearch: false

@noborus
Copy link
Owner

noborus commented Aug 30, 2024

Thank you!

That's why an event will occur one character? !

Will it work correctly by canceling the incremental search when there is a pending event?

diff --git a/oviewer/search.go b/oviewer/search.go
index 7ba9f17..e463a4a 100644
--- a/oviewer/search.go
    b/oviewer/search.go
@@ -535,6  535,9 @@ func (root *Root) sendSearchMove(lineNum int) {
 
 // incrementalSearch performs incremental search by setting and input mode.
 func (root *Root) incrementalSearch(ctx context.Context) {
 	if root.Screen.HasPendingEvent() {
 		return
 	}
 	if !root.Config.Incsearch {
 		return
 	}

@aoyama-val
Copy link
Author

Thank you for investing. Now it's working perfectly 🎉

@noborus
Copy link
Owner

noborus commented Sep 1, 2024

Thank you for reporting.
Fixed with #616.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants