bugGNU Octave - Bugs: bug #58370, interpreter doesn't accept...


bug #58370: interpreter doesn't accept multiline input in interactive mode

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Thu 14 May 2020 10:17:40 PM UTC  
Category:  Interpreter Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Patch Submitted Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Wed 27 May 2020 08:10:46 PM UTC, comment #2: 

Thanks, I tested this patch and it works perfectly for the few simple examples I have for this feature, but yeah, I haven't tested extensively to see if it causes other problems in interactive use.

Mike Miller <mtmiller>
Project Administrator
Fri 15 May 2020 05:55:56 AM UTC, comment #1: 

The attached patch appears to work for me but I haven't done much testing to see whether it might cause some other problems.

(file #49078)

John W. Eaton <jwe>
Project Administrator
Thu 14 May 2020 10:17:40 PM UTC, original submission:  

It would be a nice and consistent feature if the interpreter accepted and handled multiline input when running in interactive mode.

This would allow editing complex multiline expressions and executing them at once at the terminal prompt, allow using readline bracketed paste mode with multiple lines of commands/functions, and be more consistent with bash and other readline-based interpreters.

A very simple example that does not work for me with Octave from the default branch


Copy and paste these two lines of text with 'enable-bracketed-paste' enabled in the readline config file ~/.inputrc. Or, at the Octave prompt, type 'true', followed by Ctrl+v and Ctrl+j to start a new line, then type 'false', followed by Enter. Only the first command is executed in both cases, the rest of the text seems to be eaten and ignored by the lexer.

My best guess is the lexer is designed to be line-oriented only when running in interactive mode, and when it sees a newline it immediately stops and discards the rest of the input buffer, assuming that the newline is the end of input.

Mike Miller <mtmiller>
Project Administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #49078:  multi-line-diffs.txt added by jwe (7KiB - text/plain)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jwe (Updated the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-05-27 mtmiller StatusNone => Patch Submitted
    2020-05-15 jwe Attached File- => Added multi-line-diffs.txt, #49078
    2020-05-14 mtmiller Carbon-CopyRemoved 80942 => -

    Back to the top

    Powered by Savane 3.5