Some characters are missing when pasted to search prompt with Cmd + v
- 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.
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()
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
Ummm. I don't know where the cause is yet.
Disabled incremental search and it is working well.
Incsearch: false
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
}
Thank you for investing. Now it's working perfectly 🎉
Thank you for reporting. Fixed with #616.