~richardhuxton

Trackers

~richardhuxton/postgresql-redis-fdw-deb

Last active 10 months ago

~richardhuxton/advent2020-go

Last active 1 year, 4 months ago

#8 bindings: <C-h> = :prev-tab<Enter> broken in 0.6.0 10 months ago

Comment by ~richardhuxton on ~rjarry/aerc

I added this line just above line 243 in widgets/aerc.go

aerc.logger.Printf("bindings.GetBinding(%v)", aerc.pendingKeys)

The codes I got for ctrl+h were {0 8 8} (no modifier, key=8, rune=8) which does indeed look like a backspace.

I noticed config/bindings.go had a list of keys and then tried binding <bs> - which seemed to work for me. If that is the same for the other commenters then we have a simple work-around at least.

Could the behaviour have changed back when the modifier was added to the KeyStroke struct? The tcell change just being a coincidence?

#9 "too many open files" error on maildir 10 months ago

Comment by ~richardhuxton on ~rjarry/aerc

I think the error is in worker/maildir/message.go method NewReader. That method claims to read a message into memory but in fact opens a file, returns an io.Reader based on it and then looks like it leaks the filehandle.

I tested the patch shown below using ulimit -n 40 and then starting aerc from the same shell. Without the change you get the "..." loading indicator that gets stuck. With the change, it seems to load just fine.

I'm not very familiar with Go's standard library, so if the use of ioutil/bytes looks wrong it probably is.

diff --git a/worker/maildir/message.go b/worker/maildir/message.go
index dbc9ade..5752694 100644
--- a/worker/maildir/message.go
+++ b/worker/maildir/message.go
@@ -1,9 +1,10 @@
 package maildir
 
 import (
-       "bufio"
+       "bytes"
        "fmt"
        "io"
+       "io/ioutil"
 
        "github.com/emersion/go-maildir"
        "github.com/emersion/go-message"
@@ -25,7 +26,12 @@ func (m Message) NewReader() (io.Reader, error) {
        if err != nil {
                return nil, err
        }
-       return bufio.NewReader(f), nil
+       defer f.Close()
+       contents, err := ioutil.ReadAll(f)
+       if err != nil {
+               return nil, err
+       }
+       return bytes.NewReader(contents), nil
 }
 
 // Flags fetches the set of flags currently applied to the message.

#3 Day 07 - parse word slice to BagRule 1 year, 4 months ago

on ~richardhuxton/advent2020-go

REPORTED RESOLVED FIXED

#3 Day 07 - parse word slice to BagRule 1 year, 8 months ago

ToDo added by ~richardhuxton on ~richardhuxton/advent2020-go

#2 Day 07 - parse line to slice of words 1 year, 8 months ago

ToDo added by ~richardhuxton on ~richardhuxton/advent2020-go

#3 Day 07 - parse word slice to BagRule 1 year, 8 months ago

Ticket created by ~richardhuxton on ~richardhuxton/advent2020-go

#2 Day 07 - parse line to slice of words 1 year, 8 months ago

Ticket created by ~richardhuxton on ~richardhuxton/advent2020-go

#1 Day 07 - recursive count of bags 1 year, 8 months ago

ToDo added by ~richardhuxton on ~richardhuxton/advent2020-go

#1 Day 07 - recursive count of bags 1 year, 8 months ago

Ticket created by ~richardhuxton on ~richardhuxton/advent2020-go

label:todo