Mercurial > octave
comparison 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 |
comparison
equal
deleted
inserted
replaced
9319:0d9178575dd7 | 9320:080dc45ea682 |
---|---|
775 // leave some junk files around if we exit abnormally. | 775 // leave some junk files around if we exit abnormally. |
776 | 776 |
777 atexit (do_octave_atexit); | 777 atexit (do_octave_atexit); |
778 #endif | 778 #endif |
779 | 779 |
780 // Is input coming from a terminal? If so, we are probably | |
781 // interactive. | |
782 | |
783 interactive = (! embedded | |
784 && isatty (fileno (stdin)) && isatty (fileno (stdout))); | |
785 | |
786 if (! interactive && ! forced_line_editing) | |
787 line_editing = false; | |
788 | |
780 // These can come after command line args since none of them set any | 789 // These can come after command line args since none of them set any |
781 // defaults that might be changed by command line options. | 790 // defaults that might be changed by command line options. |
782 | 791 |
783 initialize_command_input (); | 792 if (line_editing) |
793 initialize_command_input (); | |
784 | 794 |
785 if (! inhibit_startup_message) | 795 if (! inhibit_startup_message) |
786 std::cout << OCTAVE_STARTUP_MESSAGE "\n" << std::endl; | 796 std::cout << OCTAVE_STARTUP_MESSAGE "\n" << std::endl; |
787 | 797 |
788 if (traditional) | 798 if (traditional) |
803 | 813 |
804 initialize_history (read_history_file); | 814 initialize_history (read_history_file); |
805 | 815 |
806 if (! inhibit_startup_message && reading_startup_message_printed) | 816 if (! inhibit_startup_message && reading_startup_message_printed) |
807 std::cout << std::endl; | 817 std::cout << std::endl; |
808 | |
809 // Is input coming from a terminal? If so, we are probably | |
810 // interactive. | |
811 | |
812 interactive = (! embedded | |
813 && isatty (fileno (stdin)) && isatty (fileno (stdout))); | |
814 | |
815 if (! interactive && ! forced_line_editing) | |
816 line_editing = false; | |
817 | 818 |
818 // If there is an extra argument, see if it names a file to read. | 819 // If there is an extra argument, see if it names a file to read. |
819 // Additional arguments are taken as command line options for the | 820 // Additional arguments are taken as command line options for the |
820 // script. | 821 // script. |
821 | 822 |