Mercurial > hg > octave-nkf
changeset 11979:ba624b9b7679 release-3-2-x
don't garble readline settings when line editing is disabled
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 11 Jun 2009 07:13:19 +0200 |
parents | 5d0dcd492f9f |
children | bfa0fc8559b5 |
files | src/ChangeLog src/octave.cc |
diffstat | 2 files changed, 16 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-06-09 Jaroslav Hajek <highegg@gmail.com> + + * octave.cc (octave_main): Call initialize_command_input + conditionally. Move line_editing update in front of it. + 2009-06-09 Jaroslav Hajek <highegg@gmail.com> * data.cc (Flog2): Fix tests.
--- a/src/octave.cc +++ b/src/octave.cc @@ -777,10 +777,20 @@ atexit (do_octave_atexit); #endif + // Is input coming from a terminal? If so, we are probably + // interactive. + + interactive = (! embedded + && isatty (fileno (stdin)) && isatty (fileno (stdout))); + + if (! interactive && ! forced_line_editing) + line_editing = false; + // These can come after command line args since none of them set any // defaults that might be changed by command line options. - initialize_command_input (); + if (line_editing) + initialize_command_input (); if (! inhibit_startup_message) std::cout << OCTAVE_STARTUP_MESSAGE "\n" << std::endl; @@ -806,15 +816,6 @@ if (! inhibit_startup_message && reading_startup_message_printed) std::cout << std::endl; - // Is input coming from a terminal? If so, we are probably - // interactive. - - interactive = (! embedded - && isatty (fileno (stdin)) && isatty (fileno (stdout))); - - if (! interactive && ! forced_line_editing) - line_editing = false; - // If there is an extra argument, see if it names a file to read. // Additional arguments are taken as command line options for the // script.