~rjarry/aerc-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
9 4

[PATCH aerc] vaxis: update to 0.9.0

Details
Message ID
<20240617132846.329852-2-tim@timculverhouse.com>
DKIM signature
pass
Download raw message
Patch: +3 -3
Fixes several behind the scenes issues, but notably addresses scrolling
of CJK characters in the terminal widget.

Reported-by: Tianhao Wang <shrik3@mailbox.org>
Reported-by: ~runxiyu
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
---
 go.mod | 2 +-
 go.sum | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/go.mod b/go.mod
index e95e4c0c1dc9..94e98ef65cbf 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.18
require (
	git.sr.ht/~rjarry/go-opt v1.4.0
	git.sr.ht/~rockorager/go-jmap v0.5.0
	git.sr.ht/~rockorager/vaxis v0.8.5
	git.sr.ht/~rockorager/vaxis v0.9.0
	github.com/ProtonMail/go-crypto v1.0.0
	github.com/arran4/golang-ical v0.2.7
	github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964
diff --git a/go.sum b/go.sum
index f9a7cc3d6e1f..8c8733640f3c 100644
--- a/go.sum
+++ b/go.sum
@@ -2,8 +2,8 @@ git.sr.ht/~rjarry/go-opt v1.4.0 h1:YHUKRXOuoy6d57Jt2b0DRSLbxq0mz5biq+6P/npFK5s=
git.sr.ht/~rjarry/go-opt v1.4.0/go.mod h1:oEPZUTJKGn1FVye0znaLoeskE/QTuyoJw5q+fjusdM4=
git.sr.ht/~rockorager/go-jmap v0.5.0 h1:Xs8NeqpA631HUz4uIe6V+0CpWt6b+nnHF7S14U2BVPA=
git.sr.ht/~rockorager/go-jmap v0.5.0/go.mod h1:aOTCtwpZSINpDDSOkLGpHU0Kbbm5lcSDMcobX3ZtOjY=
git.sr.ht/~rockorager/vaxis v0.8.5 h1:9R8P6n05wuk9+SoA11Wo+yI18L2/qPYjWmWdvctWF6k=
git.sr.ht/~rockorager/vaxis v0.8.5/go.mod h1:h94aKek3frIV1hJbdXjqnBqaLkbWXvV+UxAsQHg9bns=
git.sr.ht/~rockorager/vaxis v0.9.0 h1:3m//McdaJxrV+MLlnnxxQblw7K6fUY2rVqzmNlmNQRw=
git.sr.ht/~rockorager/vaxis v0.9.0/go.mod h1:h94aKek3frIV1hJbdXjqnBqaLkbWXvV+UxAsQHg9bns=
github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78=
github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
-- 
2.45.2

[aerc/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<D22BVNSNYTTO.2CC89S81Z77JW@fra01>
In-Reply-To
<20240617132846.329852-2-tim@timculverhouse.com> (view parent)
DKIM signature
missing
Download raw message
aerc/patches: SUCCESS in 2m4s

[vaxis: update to 0.9.0][0] from [Tim Culverhouse][1]

[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/53340
[1]: tim@timculverhouse.com

✓ #1253246 SUCCESS aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1253246
✓ #1253247 SUCCESS aerc/patches/openbsd.yml     https://builds.sr.ht/~rjarry/job/1253247
Details
Message ID
<D22D1GBTP8DC.2ELLXDUI5MWOI@ovch.ru>
In-Reply-To
<20240617132846.329852-2-tim@timculverhouse.com> (view parent)
DKIM signature
permerror
Download raw message
Hi Tim,

> Fixes several behind the scenes issues, but notably addresses
> scrolling

Great, nice to see the goroutine leak fix finally comes to aerc. Any
progress with the messed paste issue?

-- Vitaly
Details
Message ID
<D22DW3QED896.2RQFBW1MCOWML@timculverhouse.com>
In-Reply-To
<D22D1GBTP8DC.2ELLXDUI5MWOI@ovch.ru> (view parent)
DKIM signature
pass
Download raw message
On Mon Jun 17, 2024 at 9:26 AM CDT, Vitaly Ovchinnikov wrote:
> Great, nice to see the goroutine leak fix finally comes to aerc. Any
> progress with the messed paste issue?

Hey Vitaly -

I can't remember what the paste issue was - was there a thread we discussed it
in?

-- 
Tim
Details
Message ID
<D22DX9A6CQBU.3K9W2E9KCETSI@ringo>
In-Reply-To
<D22DW3QED896.2RQFBW1MCOWML@timculverhouse.com> (view parent)
DKIM signature
pass
Download raw message
Tim Culverhouse, Jun 17, 2024 at 17:06:
> On Mon Jun 17, 2024 at 9:26 AM CDT, Vitaly Ovchinnikov wrote:
> > Great, nice to see the goroutine leak fix finally comes to aerc. Any
> > progress with the messed paste issue?
>
> Hey Vitaly -
>
> I can't remember what the paste issue was - was there a thread we discussed it
> in?

Shall I wait for vaxis 0.9.3 in a v4? :)
Details
Message ID
<D22FE0R2JTY8.3T4U3FWIP7GAP@ovch.ru>
In-Reply-To
<D22DW3QED896.2RQFBW1MCOWML@timculverhouse.com> (view parent)
DKIM signature
permerror
Download raw message
> I can't remember what the paste issue was - was there a thread we
> discussed it in?

The text gets messed up when pasting with Cmd+V in nvim insert mode in
aerc, while pasting with "p" works fine. There was a discussion about
this in April, see here:

https://lists.sr.ht/~rjarry/aerc-devel/%3CD0DW4L4EVFJ4.320CKONR199BD@ovch.ru%3E

Or look for "problems with pasting in alacritty" subject in this mailing
list.

-- Vitaly
Details
Message ID
<D22H8D248N2K.229AB4NIONIKP@timculverhouse.com>
In-Reply-To
<D22FE0R2JTY8.3T4U3FWIP7GAP@ovch.ru> (view parent)
DKIM signature
pass
Download raw message
On Mon Jun 17, 2024 at 11:16 AM CDT, Vitaly Ovchinnikov wrote:
> > I can't remember what the paste issue was - was there a thread we
> > discussed it in?
>
> The text gets messed up when pasting with Cmd+V in nvim insert mode in
> aerc, while pasting with "p" works fine. There was a discussion about
> this in April, see here:
>
> https://lists.sr.ht/~rjarry/aerc-devel/%3CD0DW4L4EVFJ4.320CKONR199BD@ovch.ru%3E
>
> Or look for "problems with pasting in alacritty" subject in this mailing
> list.

Ah yes I remember now. I wasn't able to figure out the issue from the
alacritty.recording, and i can't reproduce locally. Do you have a linux VM you
could test in? I wonder if this is somehow a mac-only issue?

-- 
Tim
Details
Message ID
<D22IXFSZ4D20.3EDCLWR5MBFC3@ovch.ru>
In-Reply-To
<D22H8D248N2K.229AB4NIONIKP@timculverhouse.com> (view parent)
DKIM signature
permerror
Download raw message
> Ah yes I remember now. I wasn't able to figure out the issue from the
> alacritty.recording, and i can't reproduce locally. Do you have a
> linux VM you could test in? I wonder if this is somehow a mac-only
> issue?

I've just reproduced it on FreeBSD directly in both Alacritty and xterm
and on Linux via SSH from Mac. So it doesn't look Mac-specific to me.

Note that this is still Vaxis 0.8.5 or something, the one which is used
in current aerc. If the patched version has a chance to behave better -
let me know.

Here are the steps, I wonder if someone else could reproduce that.

1. Make sure you can yank and paste to/from system clipboard with vim;
2. Reply to this email in aerc+nvim;
3. Leave some space around and make a block of letters this way:
	50ia<esc>yy50p
4. Cut this block to the system clipboard by pressing dap
5. Switch to the insert mode and press Shift+Ins/Ctrl+V/Cmd+V to paste
   the block back from the system clipboard.

See if you get the straight block of 'a' back. I don't.

-- Vitaly
Details
Message ID
<D22KIRD76J60.1BWTE0UDFRPWQ@timculverhouse.com>
In-Reply-To
<D22FE0R2JTY8.3T4U3FWIP7GAP@ovch.ru> (view parent)
DKIM signature
pass
Download raw message
On Mon Jun 17, 2024 at 11:16 AM CDT, Vitaly Ovchinnikov wrote:
> > I can't remember what the paste issue was - was there a thread we
> > discussed it in?
>
> The text gets messed up when pasting with Cmd+V in nvim insert mode in
> aerc, while pasting with "p" works fine. There was a discussion about
> this in April, see here:
>
> https://lists.sr.ht/~rjarry/aerc-devel/%3CD0DW4L4EVFJ4.320CKONR199BD@ovch.ru%3E
>
> Or look for "problems with pasting in alacritty" subject in this mailing
> list.
>
> -- Vitaly

Ah I found the issue. First, when you are putting on trace logging it's probably
slowing down the system enough that it can handle all the events as they come.

The main event loop has deadlock prevention:

```go
    func (vx *Vaxis) PostEvent(ev Event) {
	    log.Debug("[event] %#v", ev)
	    select {
	    case vx.queue <- ev:
		    return
	    default:
		    log.Warn("Event dropped: %T", ev)
	    }
    }
```

If the event queue fills, we start to drop events so that we never deadlock. The
default size is 1024 - Your (50 + 1) * 50 text paste is definitely enough to
fill this up. I tried it out with just using `VAXIS_LOG_LEVEL=warn` and was able
to see the key events being dropped. It becomes even more obvious if your line
of characters is `abcdefghijklmnopqrstubwxyz`.

I propose that (in Vaxis), we still deliver bracketed paste Start and End
events. And in between, we consume in chunks up to 4096 bytes in size. If we hit
the limit, we deliver the Paste event as a string, and keep consuming until the
end. aerc would need to handle the event slightly differently. This would be a
breaking change in Vaxis but one that I think it worth making.

-- 
Tim
Details
Message ID
<D22W1OADWD2G.2WD19E6B84RJ@ovch.ru>
In-Reply-To
<D22KIRD76J60.1BWTE0UDFRPWQ@timculverhouse.com> (view parent)
DKIM signature
permerror
Download raw message
> Ah I found the issue.

Perfect! Thank you.

> This would be a breaking change in Vaxis but one that I think it worth
> making.

Well, I believe we should be able to paste long text anyways. Looking
forward to testing the new version.

-- Vitaly
Reply to thread Export thread (mbox)