Mercurial > octave
diff src/octave.cc @ 9320:080dc45ea682
don't garble readline settings when line editing is disabled
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 09 Jun 2009 11:17:53 +0200 |
parents | 9c2349a51218 |
children | 9b87aeb24ea9 |
line wrap: on
line diff
--- a/src/octave.cc Tue Jun 09 07:12:08 2009 +0200 +++ b/src/octave.cc Tue Jun 09 11:17:53 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.