diff options
author | axel <axel@liljencrantz.se> | 2006-03-10 23:38:09 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-03-10 23:38:09 +1000 |
commit | 32b531667aa1e7f085b8316ffd5c8df7f6b3987c (patch) | |
tree | 154a49403412d633d396390b447dbd97001f51dd /input.c | |
parent | c47dae77a4a6c4789fc730d471502bcebdcb8c76 (diff) |
Fix bug that causing terminal corruption if a job is put under job control before running in interactive mode. This is fixed by doing more inits at startup (but only slightly more)
darcs-hash:20060310133809-ac50b-d31cd7bab1a3a58de2833f73735817a3d0b3ed7d.gz
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -228,6 +228,8 @@ static int inputrc_block_count=0; */ static int inputrc_error = 0; +static int is_init = 0; + wchar_t input_get_code( wchar_t *name ) { @@ -1346,6 +1348,11 @@ int input_init() { wchar_t *fn; + if( is_init ) + return 1; + + is_init = 1; + input_common_init( &interrupt_handler ); if( setupterm( 0, STDOUT_FILENO, 0) == ERR ) @@ -1424,6 +1431,11 @@ static void destroy_mapping( const void *key, const void *val ) void input_destroy() { + if( !is_init ) + return; + + is_init=0; + input_common_destroy(); hash_foreach( &all_mappings, &destroy_mapping ); |