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?
Comment by ~richardhuxton on ~rjarry/aerc
I think the error is in
worker/maildir/message.go
methodNewReader
. That method claims to read a message into memory but in fact opens a file, returns anio.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.
on ~richardhuxton/advent2020-go
REPORTED
RESOLVED FIXEDToDo added by ~richardhuxton on ~richardhuxton/advent2020-go
ToDo added by ~richardhuxton on ~richardhuxton/advent2020-go
Ticket created by ~richardhuxton on ~richardhuxton/advent2020-go
Ticket created by ~richardhuxton on ~richardhuxton/advent2020-go
ToDo added by ~richardhuxton on ~richardhuxton/advent2020-go
Ticket created by ~richardhuxton on ~richardhuxton/advent2020-go
label:todo