moar icon indicating copy to clipboard operation
moar copied to clipboard

Paste in search field not working

Open ciscohack opened this issue 2 years ago • 5 comments

Hi Walles,

Can you please address an issue in moar pager where when one try to copy/paste any search keyword in search field by pressing "/" not working.

ciscohack avatar Oct 04 '21 05:10 ciscohack

Confirming.

And FYI I'm a person, not a team.

walles avatar Oct 04 '21 06:10 walles

Confirming.

And FYI I'm a person, not a team.

I am sorry for that.

ciscohack avatar Oct 04 '21 07:10 ciscohack

@walles will you be going to fix this issue and allow to copy/paste in search field

ciscohack avatar Oct 08 '21 17:10 ciscohack

I haven't looked into it, but I'm not sure I can fix it.

I'm reading characters from stdin (basically), and if the pasted chars don't show up there there's not much I can do about it.

So I'd say:

  • I agree this is a valid issue
  • Don't hold your breath for a solution

walles avatar Oct 08 '21 18:10 walles

Sure no problem. Thanks for ack

ciscohack avatar Oct 08 '21 18:10 ciscohack

Experimenting with iTerm's advanced paste tool, i found that setting chunking to anything other than 1 byte will fail to paste, and setting the interchunk delay to 1ms will drop characters. Screenshot 2023-01-09 at 11 19 43 AM

I would think there's alternative ways to read from stdin which should allow multibyte chunked stdin reads, but then again, i don't know how much it would take to resolve this.

forivall avatar Jan 09 '23 19:01 forivall

Aha, found the --trace option, here's an example

~pubrepos/moar master
» moar --trace moar.go
Please post the following report at <https://github.com/walles/moar/issues>,
or e-mail it to [email protected].

Version: v1.11.3
LANG   : en_CA.UTF-8
TERM   : xterm-256color

GOOS    : darwin
GOARCH  : arm64
Compiler: gc
NumCPU  : 10

DEBU[0000] Counted 434 lines in 0ms at 32ns/line
DEBU[0000] Stream read in 0ms
TRAC[0001] ttyin high watermark bumped to 1 bytes
TRAC[0001] Handling rune event '/'/0x002f...
TRAC[0002] ttyin high watermark bumped to 4 bytes
DEBU[0002] Unhandled multi character terminal escape sequence(s): moar
TRAC[0002] Handling key event 1...
TRAC[0003] Handling rune event 'q'/0x0071...

seems like the target line is Unhandled multi character terminal escape sequence(s): moar

Also, it might be worthwhile to support paste bracketing / Bracketed paste

If i enable it manually, i get the following trace:

~pubrepos/moar master 12s
» moar --trace moar.go
DEBU[0000] Counted 434 lines in 0ms at 23ns/line
Please post the following report at <https://github.com/walles/moar/issues>,
or e-mail it to [email protected].

Version: v1.11.3
LANG   : en_CA.UTF-8
TERM   : xterm-256color

GOOS    : darwin
GOARCH  : arm64
Compiler: gc
NumCPU  : 10

DEBU[0000] Stream read in 0ms
TRAC[0006] ttyin high watermark bumped to 11 bytes
DEBU[0006] Unhandled multi character mouse escape sequence(s):
DEBU[0006] Unhandled multi character terminal escape sequence(s):
TRAC[0007] Handling rune event '/'/0x002f...
TRAC[0012] Handling key event 0...
TRAC[0013] Handling rune event 'q'/0x0071...

here, the parser recognizes the paste as an unknown escape sequence, as bracketed paste surrounds the paste with escape sequences.

forivall avatar Jan 09 '23 19:01 forivall

That --trace output was really interesting, so it seems like it's moar that might be botching this somehow.

I might be able to work with this.

Nice finding @forivall!

walles avatar Jan 11 '23 09:01 walles

New release out: https://github.com/walles/moar/releases/tag/v1.11.4

Homebrew packaging in progress: https://github.com/Homebrew/homebrew-core/pull/120316

walles avatar Jan 11 '23 10:01 walles

@forivall if you want paste bracketing, please open a separate ticket for that!

walles avatar Jan 11 '23 10:01 walles