be a stream that supports "unget". In such a case there may be
content to get, but not from the file descriptor.
-- event:free - And register event from the focus pane which is supposed
+- event:free - Any register event from the focus pane which is supposed
to call the given comm2 will be deactivated. If no comm2 command is
given, all registered event for the given focus pane are deregistered.
Note that when a pane is closed, the event subsystem detects this and
- [X] ->replace_pane, ->replace_popup can be deleted (Abort) but we
don't catch it...
- [X] notmuch reply should interpolate the first *visible* text part
-- [ ] ncurses - don't block in nc_external_viewer - at least abort after
+- [X] ncurses - don't block in nc_external_viewer - at least abort after
30 seconds, but preferrably switch to a mode which leaves
everything else running.
- [ ] lang-python should put each module in a separate module
### ncurses
-- [ ] don't block in nc_external_viewer - at least abort after
+- [X] don't block in nc_external_viewer - at least abort after
30 seconds, but preferrably switch to a mode which leaves
everything else running.
- [ ] add full list of colour names (to lib-colourmap)
long last_event;
bool did_close;
+ bool suspended;
struct buf paste_buf;
time_t paste_start;
}
}
+DEF_CB(ns_resume)
+{
+ struct display_data *dd = ci->home->data;
+
+ if (dd->suspended) {
+ dd->suspended = False;
+ set_screen(ci->home);
+ doupdate();
+ }
+ return 1;
+}
+
DEF_CMD(nc_external_viewer)
{
struct pane *p = ci->home;
n -= read(fileno(dd->scr_file), buf,
n <= (int)sizeof(buf) ? n : (int)sizeof(buf));
endwin();
+ /* stay in raw mode */
+ raw();
+ noecho();
/* Endwin doesn't seem to reset properly, at least on xfce-terminal.
* So do it manually
tputs(dd->clear, 1, nc_putc);
fflush(dd->scr_file);
- fprintf(dd->scr_file, "# Consider copy-pasting following\n");
+ fprintf(dd->scr_file, "# Consider copy-pasting following\r\n");
if (fqdn && path[0] == '/') {
/* File will not be local for the user, so help them copy it. */
const char *tmp = fnormalize(p, ci->str2 ?: "XXXXXX");
tmp, fqdn, fname);
path = "$f";
}
- fprintf(dd->scr_file, "xdg-open %s\n", path);
- fprintf(dd->scr_file, "# Press Enter to continue\n");
- n = read(fileno(dd->scr_file), buf, sizeof(buf));
free(fqdn);
- doupdate();
+ fprintf(dd->scr_file, "xdg-open %s\r\n", path);
+ fprintf(dd->scr_file, "# Press Enter to continue\r\n");
+ dd->suspended = True;
+ call_comm("event:timer", p, &ns_resume, 30*1000);
return 1;
}
DEF_CMD(nc_refresh_post)
{
struct pane *p = ci->home;
+ struct display_data *dd = p->data;
struct pane *p1;
PANEL *pan, *pan2;
+ if (dd->suspended)
+ return 1;
+
set_screen(p);
/* Need to ensure stacking order and panel y,x position
wait_for(dd);
set_screen(p);
while ((is_keycode = get_wch(&c)) != ERR) {
+ if (dd->suspended && c != KEY_MOUSE) {
+ dd->suspended = False;
+ doupdate();
+ call_comm("event:free", p, &ns_resume);
+ /* swallow the key */
+ continue;
+ }
if (paste_recv(p, is_keycode, c))
continue;
if (c == KEY_MOUSE) {