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

 
 

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

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

Add a New Comment Rich Markup
   

Wed 27 Jan 2021 02:51:01 PM UTC, comment #5: 

Just in case someone looks here, I pushed the following changesets so that the GUI terminal now handles bracketed paste mode and to improve handling of multi-line pasted input:

http://hg.savannah.gnu.org/hgweb/octave/rev/3180f830d396
http://hg.savannah.gnu.org/hgweb/octave/rev/036079c9ee12
http://hg.savannah.gnu.org/hgweb/octave/rev/cabb840fc3f6

John W. Eaton <jwe>
Group administrator
Wed 10 Jun 2020 11:42:03 PM UTC, comment #4: 

This works for me with version 6 and 7, and I haven't noticed any negative side effects, closing as fixed.

Mike Miller <mtmiller>
Group Member
Fri 05 Jun 2020 03:42:57 PM UTC, comment #3: 

I pushed the following change to stable and merged with default:

http://hg.savannah.gnu.org/hgweb/octave/rev/808e3964987b

John W. Eaton <jwe>
Group administrator
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>
Group Member
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>
Group 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


true
false


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>
Group Member

 

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

Attach Files:
   
   
Comment:
   

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-06-10 mtmiller StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2020-06-05 jwe StatusPatch Submitted Ready For Test
    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.13-02a9.
    Corresponding source code