Can rlwrap use a wrapped command's own TAB completion?

前端 未结 2 1606
野性不改
野性不改 2020-12-11 15:36

I want to use rlwrap with a custom erlang repl.

It works perfectly if I run it as \"rlwrap -a myrepl\".

The problem is that myrepl has builtin tab completion

2条回答
  •  猫巷女王i
    2020-12-11 16:14

    You can't use rlwrap's line editing/history and your repl's TAB completion at the same time.

    rlwrap provides line editing, history and (very simple) completion for commands that don't have it. A command that has something as fancy as TAB completion shouldn't need rlwrap to do its line editing, should it?

    The -a (--always-readline) option is a rather crude way to substitute rlwrap's line editing behaviour for that of your command. It is primarily meant for commands that have a very simple line editor, without e.g. command history

    If you want to use the -a option because you prefer rlwrap's fanciness (like persistent history, or coloured prompts) to your command's (like TAB completion), go ahead, but it is impossible to pick some fanciness of one and keep some of the other.

    This is the (small) price programs (and their users) have to pay for avoiding the readline library and the GPL license that comes with it.

    Hans (rlwrap author)


    Edit (April 2017):

    In many cases it will be possible to use a filter to restore completion. See A node shell based on readline for an example of this.

提交回复
热议问题