ttymode_set() -> ttymode_reset().
This commit is contained in:
committed by
Tatsuya Kinoshita
parent
78ae4478df
commit
df84882eb3
20
terms.c
20
terms.c
@@ -575,6 +575,7 @@ save_first_animation_frame(const char *path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ttymode_set(int mode, int imode);
|
void ttymode_set(int mode, int imode);
|
||||||
|
void ttymode_reset(int mode, int imode);
|
||||||
|
|
||||||
void
|
void
|
||||||
put_image_sixel(char *url, int x, int y, int w, int h, int sx, int sy, int sw, int sh)
|
put_image_sixel(char *url, int x, int y, int w, int h, int sx, int sy, int sw, int sh)
|
||||||
@@ -608,8 +609,7 @@ put_image_sixel(char *url, int x, int y, int w, int h, int sx, int sy, int sw, i
|
|||||||
(str_url = save_first_animation_frame(url))) {
|
(str_url = save_first_animation_frame(url))) {
|
||||||
url = str_url->ptr;
|
url = str_url->ptr;
|
||||||
}
|
}
|
||||||
ttymode_set(ISIG, 1);
|
ttymode_set(ISIG, 0);
|
||||||
|
|
||||||
|
|
||||||
argv[0] = "img2sixel";
|
argv[0] = "img2sixel";
|
||||||
argv[1] = "-l";
|
argv[1] = "-l";
|
||||||
@@ -638,7 +638,7 @@ put_image_sixel(char *url, int x, int y, int w, int h, int sx, int sy, int sw, i
|
|||||||
else if (pid > 0) {
|
else if (pid > 0) {
|
||||||
int status;
|
int status;
|
||||||
waitpid(pid, &status, 0);
|
waitpid(pid, &status, 0);
|
||||||
ttymode_set(ISIG, 0);
|
ttymode_reset(ISIG, 0);
|
||||||
mySignal(SIGINT, previntr);
|
mySignal(SIGINT, previntr);
|
||||||
mySignal(SIGQUIT, prevquit);
|
mySignal(SIGQUIT, prevquit);
|
||||||
mySignal(SIGTSTP, prevstop);
|
mySignal(SIGTSTP, prevstop);
|
||||||
@@ -662,6 +662,20 @@ get_pixel_per_cell(int *ppc, int *ppl)
|
|||||||
int wp,hp,wc,hc;
|
int wp,hp,wc,hc;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
/* screen replaces ws.ws_col and ws.ws_row alone. */
|
||||||
|
#if 0
|
||||||
|
#ifdef TIOCGWINSZ
|
||||||
|
struct winsize ws;
|
||||||
|
if (ioctl(tty, TIOCGWINSZ, &ws) == 0 && ws.ws_ypixel > 0 && ws.ws_row > 0 &&
|
||||||
|
ws.ws_xpixel > 0 && ws.ws_col > 0) {
|
||||||
|
*ppc = ws.ws_xpixel / ws.ws_col;
|
||||||
|
*ppl = ws.ws_ypixel / ws.ws_row;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
fputs("\x1b[14t\x1b[18t",ttyf); flush_tty();
|
fputs("\x1b[14t\x1b[18t",ttyf); flush_tty();
|
||||||
|
|
||||||
p = buf;
|
p = buf;
|
||||||
|
Reference in New Issue
Block a user