在 zsh 的反向历史搜索中,是否有最多返回的项目数?

发布于 2024-10-07 18:19:19 字数 146 浏览 0 评论 0原文

我整天在 zsh 中使用 control-r 交互式反向历史搜索。刚才我试图找到一些我已经很长时间没有使用过的东西,但它不在那里。但是当我 grep 我的 .zsh_history 文件时,它就在那里。

反向搜索的历史记录条目数是否有最大限制?我可以配置这个吗?

I use control-r interactive reverse history search in zsh all day long. Just now I tried to find something I haven't used in quite some time, and it wasn't there. But when I grepped my .zsh_history file, it was there.

Is there a maximum # of history entries reverse search will search? Can I configure this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风透绣罗衣 2024-10-14 18:19:19

您可以配置(在您的 .zshrc 中)每个会话和存储的历史记录的长度:

HISTSIZE=5000 # session history size
SAVEHIST=1000 # saved history
HISTFILE=~/.zshistory # history file

这就是 zsh 搜索的内容,我不知道 reverse-history 的限制-search 使用。

您可能需要查看 zsh-param(1) 手册页。

You can configure (in your .zshrc) how long the history per session and the stored one is:

HISTSIZE=5000 # session history size
SAVEHIST=1000 # saved history
HISTFILE=~/.zshistory # history file

That is what is searched by zsh, I am not aware of a limit that reverse-history-search uses.

You might want to check on the zsh-param(1) man page.

ˇ宁静的妩媚 2024-10-14 18:19:19

内存中历史记录可能不包含历史文件中的条目(如果文件大小限制大于内存中限制),并且历史文件可能不包含内存中的条目(直到它们被显式写入)或者当 shell 退出时 - 受环境变量设置的大小限制)。 reverse-history-search 没有其他限制。

Bash 中也是如此,我相信 Z shell 也是类似的。

In-memory history may not contain entries that are in the history file (if the file size limit is larger than the in-memory limit) and the history file may not contain entries that are in memory (until they're written - either explicitly or when the shell exits - subject to size limits set by environment variables). There is no other limit on reverse-history-search.

This is true in Bash and I believe the Z shell is similar.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文