### Triage
-- [ ] w3m hangs for CAAmjac0r78WpiYW9FsJK=+E8-FG4MoxD2zkUJS_oCRyNW+=rug@mail.gmail.com
+- [X] w3m hangs for CAAmjac0r78WpiYW9FsJK=+E8-FG4MoxD2zkUJS_oCRyNW+=rug@mail.gmail.com
It is writing to stdout which is reading very slowly.
-- [ ] in filename competion, TAB might add a '/' to a partial name and
+- [ ] in filename completion, TAB might add a '/' to a partial name and
then get confused.
- [X] when search succeeds on final line then trying again loops back to
there, redraw is strange
import os, fcntl
import subprocess
+import tempfile
def get_attr(tagl, tag, attr):
# Find attr="stuff" in tag, but search for tag in tagl
def handle_visible(self, key, focus, **a):
"handle:convert-now"
+ tf = tempfile.TemporaryFile()
+ tf.write(self.content.encode())
+ tf.seek(0)
+
p = subprocess.Popen(["/usr/bin/w3m", "-halfdump", "-o", "ext_halfdump=1",
"-I", "UTF-8", "-O", "UTF-8",
"-o", "display_image=off",
close_fds = True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
- stdin=subprocess.PIPE)
+ stdin=tf.fileno())
self.pipe = p
- # FIXME this could block if pipe fills
- os.write(p.stdin.fileno(), self.content.encode())
- p.stdin.close()
- p.stdin = None
fd = p.stdout.fileno()
fcntl.fcntl(fd, fcntl.F_SETFL,
fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK)