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
ZSH and subshell has two prompts #1550
Comments
I can't reproduce the problem on zsh 5.6.2 with fzf 0.18.0. My zshrc has only a single line, |
I have the same issue and can replicate the problem with the above command. fzf 0.18.0
|
I found my cause of the problem! My process: If I start zsh without loading my profile, the problem goes away. So it has to do with my settings somehow. I found that when I uncomment a line to add a preexec hook, then the problem goes away. In that preexec command, I try to set the title of the terminal. The title should contain the command name. This is a good hint. It might also have to do with my I so I tried changing that part of the code: # From
local terminal_title_format="$2 [%4~]"
print -Pn "\033]0;${terminal_title_format}\007"
# To
(
setopt nopromptsubst
local terminal_title_format="$2 [%4~]"
print -Pn "\033]0;${terminal_title_format}\007"
) and now there is no problem, but my terminal title still works. I've been suffering this for weeks, but didn't really investigate until now. |
@Mange that sounds very similar to what I would have been doing, thanks for the write up! |
If I run fzf within a subshell, it seems to 'prompt' twice - and the first selection is ignored. In other words, it requires two "enter" to be pressed twice on the keyboard before it returns back to the cli.
This behaviour only occurs within zsh for me - works fine in bash.
echo "$(echo 'test' | fzf)"
can be used to reproduce the issue.The text was updated successfully, but these errors were encountered: