882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
|
if (inst->master_fd >= 0) {
pty_close();
inst->master_fd = -1;
gtk_input_remove(inst->master_func_id);
}
if (!inst->exited && back->exitcode() >= 0) {
int exitcode = back->exitcode();
int clean;
clean = WIFEXITED(exitcode) && (WEXITSTATUS(exitcode) == 0);
/*
* Terminate now, if the Close On Exit setting is
* appropriate.
|
|
|
|
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
|
if (inst->master_fd >= 0) {
pty_close();
inst->master_fd = -1;
gtk_input_remove(inst->master_func_id);
}
if (!inst->exited && back->exitcode(backhandle) >= 0) {
int exitcode = back->exitcode(backhandle);
int clean;
clean = WIFEXITED(exitcode) && (WEXITSTATUS(exitcode) == 0);
/*
* Terminate now, if the Close On Exit setting is
* appropriate.
|
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
|
exit(0);
}
gint timer_func(gpointer data)
{
struct gui_data *inst = (struct gui_data *)data;
if (back->exitcode() >= 0) {
/*
* The primary child process died. We could keep the
* terminal open for remaining subprocesses to output to,
* but conventional wisdom seems to feel that that's the
* Wrong Thing for an xterm-alike, so we bail out now
* (though we don't necessarily _close_ the window,
* depending on the state of Close On Exit). This would be
|
|
|
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
|
exit(0);
}
gint timer_func(gpointer data)
{
struct gui_data *inst = (struct gui_data *)data;
if (back->exitcode(backhandle) >= 0) {
/*
* The primary child process died. We could keep the
* terminal open for remaining subprocesses to output to,
* but conventional wisdom seems to feel that that's the
* Wrong Thing for an xterm-alike, so we bail out now
* (though we don't necessarily _close_ the window,
* depending on the state of Close On Exit). This would be
|
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
|
make_mouse_ptr(-2); /* clean up cursor font */
inst->currcursor = inst->textcursor;
show_mouseptr(1);
term = term_init();
back = &pty_backend;
back->init((void *)term, NULL, 0, NULL, 0);
term_size(term, cfg.height, cfg.width, cfg.savelines);
ldisc_send(NULL, 0, 0); /* cause ldisc to notice changes */
inst->master_fd = pty_master_fd;
inst->exited = FALSE;
inst->master_func_id = gdk_input_add(pty_master_fd, GDK_INPUT_READ,
pty_input_func, inst);
gtk_main();
return 0;
}
|
|
|
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
|
make_mouse_ptr(-2); /* clean up cursor font */
inst->currcursor = inst->textcursor;
show_mouseptr(1);
term = term_init();
back = &pty_backend;
back->init((void *)term, &backhandle, NULL, 0, NULL, 0);
term_size(term, cfg.height, cfg.width, cfg.savelines);
ldisc_send(NULL, 0, 0); /* cause ldisc to notice changes */
inst->master_fd = pty_master_fd;
inst->exited = FALSE;
inst->master_func_id = gdk_input_add(pty_master_fd, GDK_INPUT_READ,
pty_input_func, inst);
gtk_main();
return 0;
}
|