octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #60453] Input function on windows fails to tri


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #60453] Input function on windows fails to trim carriage return character when running in batch mode
Date: Mon, 26 Apr 2021 14:16:41 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36 Edg/90.0.818.46

Update of bug #60453 (project octave):

                Category:                    None => Octave Function        
                  Status:               Need Info => Confirmed              
                 Release:                   4.4.1 => dev                    

    _______________________________________________________

Follow-up Comment #4:

I can confirm with Octave 6.2.0 and a recent build from the default branch on
Windows. But only when using the GUI.
When started with "--no-gui" it works as expected.

I guess that for some reason only the (Linux line ending) LF is stripped
instead of the complete Windows line ending CRLF.
Maybe something should be opened in text mode but it is opened in binary
mode?

It also works if I force using readline with "--line-editing".

Maybe we should always assume the Octave is run interactively if it is
starting with GUI?

Maybe something around these lines of code needs to be adapted:
https://hg.savannah.gnu.org/hgweb/octave/file/e8e9f815945a/libinterp/corefcn/interpreter.cc#l568

        // If stdin is not a tty, then we are reading commands from a
        // pipe or a redirected file.
        bool stdin_is_tty = octave_isatty_wrapper (fileno (stdin));

        m_interactive = (! is_octave_program && stdin_is_tty
                         && octave_isatty_wrapper (fileno (stdout)));

        // Check if the user forced an interactive session.
        if (options.forced_interactive ())
          m_interactive = true;

        line_editing = options.line_editing ();
        if ((! m_interactive || options.forced_interactive ())
            && ! options.forced_line_editing ())
          line_editing = false;


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60453>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]