This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

CLI autocomplete

Hey. Has anybody played with autocomplete for command line interface. I like it alot and it is very helpfull. Now a autocomplete would be cool!

Here is what comes to mind:

  • key as arrows and tab should be treated as return with the same text written again.

  • when is pressed we should compare our last argument with some kind of list.

  • when up and down arrows are pressed we should also go through some history list. I think 5 or 10 are enough.

Parents
  • This is very good news. :) You said that and history is already implemented. Is there a example or can u share how to use them already?

  • Hi, Regarding first concern. Pressing "up" shall print in command line historical command starting from last entered. If command "history" is showing for example:

    • [ 0] cmd_0
    • [ 1] cmd_1
    • [ 2] cmd_2
    • [ 3] cmd_3

    than by pressing "up" you will see cmd_3, "up" again and you will see cmd_2 and so on... But in the example you can observe following bug: if you have commands from [ 0] to [ 7] and if you will press "up" as many times to see what was cmd [ 0] than CLI will be blocked until .

    After pressing copletion shall be done automatically without any additional . If you need to press enter to see completion results it means that your terminal is not correctly configured. I will try to paste my putty settings here.

Reply
  • Hi, Regarding first concern. Pressing "up" shall print in command line historical command starting from last entered. If command "history" is showing for example:

    • [ 0] cmd_0
    • [ 1] cmd_1
    • [ 2] cmd_2
    • [ 3] cmd_3

    than by pressing "up" you will see cmd_3, "up" again and you will see cmd_2 and so on... But in the example you can observe following bug: if you have commands from [ 0] to [ 7] and if you will press "up" as many times to see what was cmd [ 0] than CLI will be blocked until .

    After pressing copletion shall be done automatically without any additional . If you need to press enter to see completion results it means that your terminal is not correctly configured. I will try to paste my putty settings here.

Children
No Data
Related