bugGNU Octave - Bugs: bug #60023, Tab completion gets confused for...


bug #60023: Tab completion gets confused for files with hyphens

Submitted by:  None
Submitted on:  Mon 08 Feb 2021 07:48:33 PM UTC  
Category:  Interpreter Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  6.1.0
Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

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


Tue 09 Feb 2021 06:27:33 PM UTC, comment #1: 

This is a known issue.  I think it will be difficult to resolve.  The typical UNIX approach is to use underscores rather than hyphens which would resolve this.

Consider this code

abc = 1;
xyz = 2;
ans = 1

In this case, the hyphen/minus sign indicates a mathematical operation and a break between variables (which can't have '-' in them).  The 'Tab Completion' operation has a definition of which characters can be variable or file names and which are not and therefore indicate a break.  In this case, if you type 'xyz-a<TAB>' the Readline library understands that '-' is not part of a name and therefore it should look for matches beginning with the next character 'a'.

There are ways this could be made to work.  If there were different completion modes, one for variables and functions and one for file names, then each mode could use a different set of characters for words.  This might be possible with Readline; I'm not sure though.

Rik <rik5>
Project Administrator
Mon 08 Feb 2021 07:48:33 PM UTC, original submission:  

Say that you have two files named foo-one.mat and foo-two.mat. On typing "load foo" at the Octave command prompt and pressing tab, Octave shows the available files beginning with "foo" including foo-one.mat and foo-two.mat but on then typing "load foo-o" and pressing tab, expecting it to complete foo-one.mat, it gets confused and gives unrelated results. Apparently the first tab lists the hyphenated names but the second tab interprets it as a minus sign not as part of a file name.

Is there a workaround for this behavior, other than to avoid the use of hyphens in file names?



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

Attach Files:

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 (Posted a comment)

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-02-09 rik5 Severity3 - Normal => 1 - Wish
        Priority5 - Normal => 3 - Low
        Item GroupPerformance => Feature Request
        StatusNone => Confirmed
        Operating SystemGNU/Linux => Any

    Back to the top

    Powered by Savane 3.5