# HG changeset patch # User Jaroslav Hajek # Date 1244539073 -7200 # Node ID 080dc45ea68232e5e2701a63e77ff8f62021e756 # Parent 0d9178575dd7f5fa7581aef889130a6832ccf86e don't garble readline settings when line editing is disabled diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 --git a/src/octave.cc b/src/octave.cc --- 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.