bugGNU Octave - Bugs: bug #62492, command line completion with...

 
 

bug #62492: command line completion with <TAB> key should be context aware

Submitter:  None
Submitted:  Fri 20 May 2022 02:32:52 PM UTC
 
Category:  Interpreter Severity:  3 - Normal
Priority:  3 - Low Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * dev
Operating System:  * Any
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Wed 25 May 2022 06:44:17 AM UTC, comment #5: 

Changing target to the development branch for this feature request.

Markus M├╝tzel <mmuetzel>
Project Member
Sat 21 May 2022 10:42:40 PM UTC, comment #4: 

Unless someone is interested in working on it now, maybe updating Octave's completion code and allowing programmable completoin would be a good GSoC project for the future?

John W. Eaton <jwe>
Project Administrator
Sat 21 May 2022 09:44:46 PM UTC, comment #3: 

Readline can do certain completion tasks with rl_attempted_completion_function but I have not seen that used inside a REPL to distinguish between files and directories or anything like that. Note that bash uses the bash-completion package which is a separate project to make it context aware for various commands like cd, sort, hg, git, and all that. So typing "sort --ran TAB" will give the choice of random-sort or random-source etc.

This sounds useful for Octave commands too (imagine typing format TAB and it lists long, short, compact, etc). But definitely a serious undertaking.

Arun Giridhar <arungiridhar>
Project Member
Sat 21 May 2022 07:35:27 PM UTC, comment #2: 

I am changing the category of this report, since this behavior is not limited to the GUI but is also present in the CLI version.

Torsten Lilge <ttl>
Project Member
Fri 20 May 2022 06:22:01 PM UTC, comment #1: 

Currently I'm not sure how much this behavior does or can check what the context is before providing suggestions. E.g., if I create the following in the current folder:

foo.m
foofoo.m
foo/
foo2/

then I get the following behavior:

>> foo<tab><tab>
foo/      foo.m     foo2/     foofoo.m
>> cd foo<tab><tab>
foo/      foo.m     foo2/     foofoo.m
>> copy foo<tab><tab>
foo/      foo.m     foo2/     foofoo.m
>> rmdir foo<tab><tab>
foo/      foo.m     foo2/     foofoo.m
>> rm foo<tab><tab>
foo/      foo.m     foo2/     foofoo.m

obviously these include contexts that would expect a file, directory, or both. 

Are there hooks in place to check the preceeding command and have some sort of file/folder/both lookup?

Nicholas Jankowski <nrjank>
Project Member
Fri 20 May 2022 02:32:52 PM UTC, original submission:  

Typing ```cd foo``` in Octave and pressing tab currently gives all foo* files and directories even if they cannot be used as arguments to cd. It would be better for Octave autocompletion to be like bash and give only directories beginning with foo when used with cd, or complete the name if there is only one such directory.

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 rik5 (Updated the item)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by arungiridhar (Posted a comment)
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by nrjank (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 project members can vote.

     

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-05-25 rik5 Priority5 - Normal 3 - Low
        StatusNone Confirmed
        Summarycd foo tab should give only directories command line completion with key should be context aware
    2022-05-25 mmuetzel Release7.1.0 dev
    2022-05-21 ttl CategoryGUI Interpreter

    Back to the top


    Powered by Savane 3.9