# HG changeset patch # User Rik # Date 1626979154 25200 # Node ID da5cc930ff106db6f10049634d989c1c8cef789d # Parent 218716316e6235b3c939e1470ecbede8182aa02f Change startup so that '--interactive' does not always force '--no-line-editing' (bug #60696). * interpreter.cc (interpreter::interpreter): Create temporary variable "forced_interactive" that holds state from the const-declared variable "options". Check if forced interactive option was given in conjunction with a session that is already interactive ("m_interactive"). If found, then reset the forced nature of session to false both in the application ("app_context") and locally in the temporary variable "forced_interactive". diff -r 218716316e62 -r da5cc930ff10 libinterp/corefcn/interpreter.cc --- a/libinterp/corefcn/interpreter.cc Thu Jul 22 13:53:43 2021 -0400 +++ b/libinterp/corefcn/interpreter.cc Thu Jul 22 11:39:14 2021 -0700 @@ -567,12 +567,20 @@ m_interactive = (! is_octave_program && stdin_is_tty && octave_isatty_wrapper (fileno (stdout))); + // Don't force interactive if we're already interactive (bug #60696). + bool forced_interactive = options.forced_interactive (); + if (m_interactive) + { + m_app_context->forced_interactive (false); + forced_interactive = false; + } + // Check if the user forced an interactive session. - if (options.forced_interactive ()) + if (forced_interactive) m_interactive = true; line_editing = options.line_editing (); - if ((! m_interactive || options.forced_interactive ()) + if ((! m_interactive || forced_interactive) && ! options.forced_line_editing ()) line_editing = false;