# HG changeset patch # User Jaroslav Hajek # Date 1244697199 -7200 # Node ID ba624b9b76791a1f7414b2a96df6633bf8fee5b7 # Parent 5d0dcd492f9f4f7fe96a8b0cff4a0100b5624efa don't garble readline settings when line editing is disabled diff -r 5d0dcd492f9f -r ba624b9b7679 src/ChangeLog --- a/src/ChangeLog Tue Jun 09 07:18:28 2009 +0200 +++ b/src/ChangeLog Thu Jun 11 07:13:19 2009 +0200 @@ -1,3 +1,8 @@ +2009-06-09 Jaroslav Hajek + + * octave.cc (octave_main): Call initialize_command_input + conditionally. Move line_editing update in front of it. + 2009-06-09 Jaroslav Hajek * data.cc (Flog2): Fix tests. diff -r 5d0dcd492f9f -r ba624b9b7679 src/octave.cc --- a/src/octave.cc Tue Jun 09 07:18:28 2009 +0200 +++ b/src/octave.cc Thu Jun 11 07:13:19 2009 +0200 @@ -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.