bugGNU Octave - Bugs: bug #55819, Octave command number doesn't...

 
 

bug #55819: Octave command number doesn't increment after Ctrl+C

Submitted by:  Dan Sebald <sebald>
Submitted on:  Sun 03 Mar 2019 05:52:18 PM UTC  
 
Category:  Interpreter Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Dan Sebald 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.

 

Sun 03 Mar 2019 08:49:47 PM UTC, comment #3:

I think this can probably be fixed by moving the call to 'command_editor::increment_current_command_number' out of the evaluator (pt-eval.cc) and into the input system (input.cc), where input lines are added to the command history. But some care has to be taken to make sure that the command number works the same with completion matches and with the debugger active.

Mike Miller <mtmiller>
Project Administrator
Sun 03 Mar 2019 06:30:04 PM UTC, comment #2:

Small correction, the return value may be assigned already if the thing being interrupted is just displaying a huge return value to the terminal output.

Mike Miller <mtmiller>
Project Administrator
Sun 03 Mar 2019 06:05:59 PM UTC, comment #1:

Confirmed with something simple like 'pause(10000)' and Ctrl+C.

Retitled to use the terminology used in liboctave. The number is the "command number", and the interpreter only increments it when an expression is evaluated and a return value is received. If the command is interrupted, there is no return value, the 'ans' variable is also not updated, and the command number is not incremented.

This is fairly low severity since most users (using the GUI) will see the '>> ' prompt, no command number.

I agree that this would be nice to fix. The bash shell for example does increment its command number when the prompt contains '\#' and a command like 'sleep 1000' is interrupted.

Mike Miller <mtmiller>
Project Administrator
Sun 03 Mar 2019 05:52:18 PM UTC, original submission:

Using octave-cli, try something like the following in which one presses Cntrl-C during a long screen dump of resulting output (say I forgot the semicolon):

Presumably the command sequence has been fully executed, as the variable is present:

But the octave line number is still at 1. It seems like it should be at 2. Neither does the line number advance when the pager is on.

Dan Sebald <sebald>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by sebald (Submitted 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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-03 rik5 Priority5 - Normal => 3 - Low
    2019-03-03 mtmiller CategoryNone => Interpreter
        Severity3 - Normal => 1 - Wish
        Item GroupIncorrect Result => Feature Request
        StatusNone => Confirmed
        SummaryOctave line number doesn't advance after Cntrl-C when resulting output => Octave command number doesn't increment after Ctrl+C

    Back to the top


    Powered by Savane 3.4