bugGNU Octave - Bugs: bug #32240, \b doesn't work when followed...

 
 

bug #32240: \b doesn't work when followed directly by \n

Submitter:  Jeremy Trammell <novalis112>
Submitted:  Tue 25 Jan 2011 05:53:31 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Jeremy Trammell Open/Closed:  * Closed
Release:  * 3.2.4 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 25 Jan 2011 09:05:07 AM UTC, comment #4: 

My previous comment did not post correctly.

I intended to say:

If by


In the command line interpreter backspace seems to be destructive


you mean that when you type backspace on the command line, the previous character is deleted, then that is happening because the readline library that handles command line input has complete control over what appears on the screen.  The printf function is only sending characters to an output stream.  It has no control over what happens after that.

John W. Eaton <jwe>
Group administrator
Tue 25 Jan 2011 08:57:36 AM UTC, comment #3: 

Then the place to fix it is in the terminal, not Octave.  Octave is sending the backspace to the terminal.  It is the terminal's job to decide what to do about that, not Octave.

If by


In the command line interpreter backspace seems to be destructive,
-vertabim-

you mean that when you are typing commands to Octave, then that is a completely different situation.  There, the readline library has complete control of what appears on the screen.  Octave's printf function only writes characters to an output stream.

John W. Eaton <jwe>
Group administrator
Tue 25 Jan 2011 08:41:50 AM UTC, comment #2: 

Suit yourself, but I spent a good half an hour banging my head on a wall because that was not the behavior I expected.  In the command line interpreter backspace seems to be destructive, not non-destructive.  I think it's natural to assume that printf would behave similarly...  At the very least, I would update the documentation to make it clear that for the purposes of printf, \b is a non-destructive backspace.

Jeremy Trammell <novalis112>
Tue 25 Jan 2011 08:31:57 AM UTC, comment #1: 

As far as I can tell, Octave is sending the sequence of characters


H I <BS> <LF>


to the  terminal.

I think the reason the I doesn't disappear when it is followed by backspace and linefeed is that neither of these are printing characters, so they don't overwrite the previous character.  When you follow the backspace character by another printing character, it overwrites the I.  This all looks like the expected behavior to me, so I'm closing this report as invalid.

John W. Eaton <jwe>
Group administrator
Tue 25 Jan 2011 05:53:31 AM UTC, original submission:  


octave-3.2.4.exe:23> printf("HI\b\n");
HI
octave-3.2.4.exe:24> printf("HI\bO\n");
HO
octave-3.2.4.exe:25>


Jeremy Trammell <novalis112>

 

(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 jwe (Posted a comment)
  • -email is unavailable- added by novalis112 (Submitted 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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-01-25 jwe Summary\\b doesn\'t work when followed directly by \\n \b doesn't work when followed directly by \n
    2011-01-25 jwe Summary\\b doesn\'t work when followed directly by \\n \b doesn't work when followed directly by \n
    2011-01-25 jwe StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
        Summary\\b doesn\'t work when followed directly by \\n \b doesn't work when followed directly by \n

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code