Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(zsh): move 'fc -RI' inside command substitution #4073

Merged
merged 2 commits into from
Nov 2, 2024

Conversation

LangLangBart
Copy link
Contributor

@LangLangBart LangLangBart commented Nov 1, 2024

description

When the selection of R is aborted with Escape, the widget assigned to the (up arrow key), which is by default up-line-or-history, ignores any input.

I don't have an explanation for why this occurs, and why it only happens in combination with the -I flag on the fc builtin command.

Moving it inside the command substitution alleviates the issue.

Related widget with fc -RI usage:
https://zsh.org/mla/users/2021/msg00186.html


to reproduce the issue

  1. Start a new session and paste the following:
test-widget() {
	fc -RI
}
zle -N test-widget

bindkey '^p' test-widget
bindkey '^[[A' up-line-or-history
  1. Press P.
  2. Press ; notice that nothing happens.

The issue doesn't occur in an environment where the HISTFILE is undefined or the assigned file is empty.

@LangLangBart
Copy link
Contributor Author

I don't have an explanation for why this occurs, and why it only happens in combination with the -I flag on the fc builtin command.

The issue doesn't occur in an environment where the HISTFILE is undefined or the assigned file is empty.

No satisfying explanation found! Giving up for now to find one.

@LangLangBart LangLangBart marked this pull request as ready for review November 1, 2024 16:07
@junegunn
Copy link
Owner

junegunn commented Nov 2, 2024

That's strange, probably a zsh bug. Anyway, thanks!

@junegunn junegunn merged commit 0607227 into junegunn:master Nov 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants