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

 
 

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

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

Add a New Comment Rich Markup
   

Sat 01 Oct 2022 07:25:57 PM UTC, comment #2: 

This seems to be the same as the older bug #53384.

Closing as duplicate.

Arun Giridhar <arungiridhar>
Group Member
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;
xyz-abc
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>
Group 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?

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 arungiridhar (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2022-10-01 arungiridhar Open/ClosedOpen Closed
    2022-10-01 arungiridhar StatusConfirmed Duplicate
    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.13-d3ae.
    Corresponding source code