X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=main.c;h=af2141e882a3a70d9a854547d495f9567d02c559;hb=20e55d4252ca2db1fc2b1099acf8393c22903575;hp=017e9b8a90ac99c412577cc526f0398814f5a777;hpb=ec42b5f9dbca7a552524c138f6764671612fe385;p=apps%2Fmadmutt.git diff --git a/main.c b/main.c index 017e9b8..af2141e 100644 --- a/main.c +++ b/main.c @@ -18,9 +18,11 @@ #include #include +#include #include #include +#include #include #include #include @@ -56,6 +58,8 @@ extern int optind; #include #include +#include + void mutt_exit(int code) { mutt_endwin(NULL); @@ -129,16 +133,6 @@ static void show_version (void) puts (_("Compile Options:")); puts ( -#ifdef USE_FCNTL - " +USE_FCNTL" -#else - " -USE_FCNTL" -#endif -#ifdef USE_FLOCK - " +USE_FLOCK" -#else - " -USE_FLOCK" -#endif #ifdef USE_HCACHE " +USE_HCACHE" #else @@ -196,6 +190,7 @@ int main (int argc, char **argv) int version = 0; int i; int explicit_folder = 0; + pthread_t pt; /* initialize random number for tmp file creation */ srand48((unsigned int) time (NULL)); @@ -311,8 +306,10 @@ int main (int argc, char **argv) } /* set defaults and read init files */ + el_initialize(); mutt_init (flags & M_NOSYSRC, commands); string_list_wipe(&commands); + pthread_create(&pt, NULL, &el_loop, NULL); if (!option(OPTNOCURSES)) { ui_layout_init(); @@ -498,6 +495,7 @@ int main (int argc, char **argv) NULL)) || !explicit_folder) { mutt_index_menu (); + if (option (OPTXTERMSETTITLES)) printf("\033]2;%s\007", NONULL(XtermLeave)); if (Context) @@ -506,7 +504,10 @@ int main (int argc, char **argv) mutt_endwin (Errorbuf); } + pthread_cancel(pt); + pthread_join(pt, NULL); luaM_shutdown(); mutt_sasl_shutdown(); + el_shutdown(); exit (0); }