aboutsummaryrefslogtreecommitdiffhomepage
path: root/input.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-03-10 23:38:09 +1000
committerGravatar axel <axel@liljencrantz.se>2006-03-10 23:38:09 +1000
commit32b531667aa1e7f085b8316ffd5c8df7f6b3987c (patch)
tree154a49403412d633d396390b447dbd97001f51dd /input.c
parentc47dae77a4a6c4789fc730d471502bcebdcb8c76 (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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/input.c b/input.c
index 9c81fb80..27b7b98e 100644
--- a/input.c
+++ b/input.c
@@ -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 );