gpt4 book ai didi

erlang-shell - 如何搜索 `iex` 或 `erl` shell 历史?

转载 作者:行者123 更新时间:2023-12-02 19:53:39 25 4
gpt4 key购买 nike

我可以使用相应的箭头键上下移动历史记录,但是对于大量历史记录来说这很麻烦,而且 CTRL-R 似乎不起作用。

看了Erlang's shell moduleElixir's IEx module文档,但他们没有提及任何相关内容。后者至少告诉how to enable it :

It is possible to get shell history by passing some options that enable it in the VM. This can be done on a per-need basis when starting IEx:

iex --erl "-kernel shell_history enabled"

If you would rather enable it on your system as a whole, you can use the ERL_AFLAGS environment variable and make sure that it is set accordingly on your terminal/shell configuration.

On Unix-like / Bash:

export ERL_AFLAGS="-kernel shell_history enabled"

On Windows:

set ERL_AFLAGS "-kernel shell_history enabled"

On Windows 10 / PowerShell:

$env:ERL_AFLAGS = "-kernel shell_history enabled"

最佳答案

引用 Erlang patches mailing list 中的内容

Search mode can be entered by pressing ctrl-r. Enter terms and pressctrl-r again to search backwards, or ctrl-s to then search forward (ifyou terminal doesn't eat up that one).

值得注意的是,OP 提到 ctrl-r 不起作用,链接的消息对 Windows 环境也是如此。根据环境的不同,此功能似乎有一些注意事项。

很难详细说明 OP 的情况,但 FWIW,该功能确实按照 macOS 10.14、iTerm2 和 Elixir 1.10.4-otp-22 中的描述工作。

关于erlang-shell - 如何搜索 `iex` 或 `erl` shell 历史?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57545993/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com