bugGNU Octave - Bugs: bug #49385, less gives error:...

 
 

bug #49385: less gives error: "undecodable token"

Submitter:  None
Submitted:  Wed 19 Oct 2016 12:16:17 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Yoni Teitelbaum Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.2
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 29 Jun 2018 02:12:01 PM UTC, comment #10: 

Please file a separate feature request that we support bracketed paste mode in Octave's command terminal window.  Unless there is a better reference, maybe it would be good to begin by referencing this page:

https://cirw.in/blog/bracketed-paste

Until then, you can avoid the messages by conditionally disabling bracketed paste mode for Octave using something like this in your ~/.inputrc file:


$if Octave
set enable-bracketed-paste off
$else
set enable-bracketed-paste on
$endif


John W. Eaton <jwe>
Group administrator
Fri 29 Jun 2018 12:38:45 PM UTC, comment #9: 

I confirm that

set enable-bracketed-paste on

in ~/.inputrc still triggers the problem with 4.4.

That readline option is useful for protecting the user from malicious copy/paste in the shell, so it would be nice to fix this issue.

Sébastien Villemot <svillemot>
Thu 10 May 2018 07:59:03 AM UTC, comment #8: 

When i set

set enable-bracketed-paste on

in my ~/.inputrc, i get this as prompt from within the octave
terminal window:

>> undecodable token: \001b(hex)[?2004l
undecodable token: \001b(hex)[?2004h


I got this with octave 4.2.1 and 4.4.
Removing that line fixed the problem for me.
Setting the TERM variable to other values had no effect.

Oliver Roese <adrastea>
Thu 03 Nov 2016 08:13:02 PM UTC, comment #7: 

Yoni - thanks for the additional details. The combination of settings that you are running Octave in will no longer produce this error with Octave 4.2, so you can consider that fixed.

In Octave 4.0, if the TERM environment variable was set, Octave used it. But in Octave 4.2 we set TERM to xterm, because Octave is the terminal, it makes no sense to act as if Octave were tmux or screen when it knows that it isn't.

As a workaround if you run


>> setenv TERM xterm


in Octave, that should get rid of the spurious control characters for you.

Other pagers, though, may still send this escape sequence as I showed with vim. Does anyone care or should we close this as fixed?

Mike Miller <mtmiller>
Group Member
Thu 20 Oct 2016 06:50:21 PM UTC, comment #6: 

Hi, original reporter of the bug here. (I only just now made an account).

@Kai, I'm running Ubuntu 14.04.

Some more specific information to reproduce this bug: it only occurs when I run octave from within a tmux session. I use tmux as part of my normal workflow, which is why I did it that way; there's no reason for me not to just run octave directly from the terminal or by clicking on the graphical icon. So I guess I'll just do that from now on.

I didn't try the zsh fix, mostly because I don't completely understand what this change is or how to carry it out quickly and reversibly. If it would be helpful in diagnosing and fixing an issue, I'm willing to try it, especially if someone can point me to some helpful reading material.

Yoni Teitelbaum <ytbaum>
Wed 19 Oct 2016 10:09:39 PM UTC, comment #5: 

I see this escape sequence printed if I set PAGER=/usr/share/vim/vim80/macros/less.sh, which runs vim in a less pager emulation mode, and does generate these escape sequences.

So yes, the Octave qterminal is incompatible with vim as pager, and possibly other pagers or programs that may run in the terminal.

Mike Miller <mtmiller>
Group Member
Wed 19 Oct 2016 06:14:19 PM UTC, comment #4: 

To be clear, I meant that the user should disable these escape sequences in their environment, not that Octave should be doing anything differently to handle/ignore them.

Other opinions?

I briefly looked at the qterminal code to handle ANSI escapes and it is a little hard to follow

http://hg.savannah.gnu.org/hgweb/octave/file/fb8b23754d76/libgui/qterminal/libqterminal/unix/Vt102Emulation.cpp#l287

Mike Miller <mtmiller>
Group Member
Wed 19 Oct 2016 06:10:03 PM UTC, comment #3: 

Confirmed, I get the same when I run the following in Octave:


>> system ("/bin/bash -c \"echo -ne '\\e[3mhello world\\e[23m'\"");
hello worldundecodable token: \001b(hex)[3m
undecodable token: \001b(hex)[23m


So this suggests there is something in the environment or in the less program that is printing the "standout" and "no standout" ANSI terminal escape sequences, but the Octave qterminal does not know how to interpret them.

Best answer here would be to disable these escape sequences (which is probably what the Arch wiki page is doing opaquely).

Mike Miller <mtmiller>
Group Member
Wed 19 Oct 2016 01:57:52 PM UTC, comment #2: 

Is the last line in the following link relevant in your case?

https://wiki.archlinux.org/index.php/Octave#Zsh_Undecodable_Token

Pantxo Diribarne <pantxo>
Group Member
Wed 19 Oct 2016 01:33:26 PM UTC, comment #1: 

Please be more specific about your Linux then. I cannot reproduce this error using openSUSE Tumbleweed, GNOME 3, Octave 4.2-rc2 and any GUI command window size.

If I run


grep -R "undecodable token"


in the repository, even online

http://hg.savannah.gnu.org/hgweb/octave/log?rev=undecodable+token

I cannot figure out a potential source of this error.

Kai Torben Ohlhus <siko1056>
Group Member
Wed 19 Oct 2016 12:16:17 PM UTC, original submission:  

In the octave GUI, whenever I try to print out a matrix that is bigger than the terminal area, I get an error that looks like this:


undecodable token: \001b(hex)[3m
undecodable token: \001b(hex)[23m


This happens even if I do something as simple as:

repmat(1.1, 16, 16)

(The exact command to repro will probably depend on the size of your screen; the point is just to make a big enough matrix).

Anonymous

 

(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 svillemot (Posted a comment)
  • -email is unavailable- added by adrastea (Posted a comment)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by ytbaum (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by None (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-07 rik5 StatusWorks For Me Fixed
        Open/ClosedOpen Closed
    2016-10-19 siko1056 Item GroupNone Incorrect Result
        StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code