diff options
author | David Shaw <[email protected]> | 2005-03-18 20:17:38 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2005-03-18 20:17:38 +0000 |
commit | 9c3484924bc23fe997699b79b7a68e73b7279533 (patch) | |
tree | 119e69bd42de87e0afeba8275c518606ff3bc976 /util/ttyio.c | |
parent | * getkey.c (get_seckey_byname2): If no explicit default key is set, don't (diff) | |
download | gnupg-9c3484924bc23fe997699b79b7a68e73b7279533.tar.gz gnupg-9c3484924bc23fe997699b79b7a68e73b7279533.zip |
* ttyio.c (tty_enable_completion, tty_disable_completion): Enable and
disable readline completion. (init_ttyfp): Completion is disabled by
default.
Diffstat (limited to '')
-rw-r--r-- | util/ttyio.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/util/ttyio.c b/util/ttyio.c index b7dd47173..5feab726e 100644 --- a/util/ttyio.c +++ b/util/ttyio.c @@ -165,6 +165,7 @@ init_ttyfp(void) #ifdef HAVE_LIBREADLINE rl_catch_signals = 0; rl_instream = rl_outstream = ttyfp; + rl_inhibit_completion = 1; #endif #endif #ifdef HAVE_TCGETATTR @@ -173,6 +174,25 @@ init_ttyfp(void) initialized = 1; } +#ifdef HAVE_LIBREADLINE +void +tty_enable_completion(rl_completion_func_t *completer) +{ + if( !initialized ) + init_ttyfp(); + rl_attempted_completion_function=completer; + rl_inhibit_completion=0; +} + +void +tty_disable_completion(void) +{ + if( !initialized ) + init_ttyfp(); + rl_inhibit_completion=1; +} +#endif + int tty_batchmode( int onoff ) { |