-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Can't input non ascii characters #3799
Comments
With the same setup, non-ascii characters make Fzf quit; it's intricate |
I found out that as soon as I removed the Regarding the export FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS//--height[=[:space:]][1-9][0-9]?/ }"
export FZF_CTRL_T_OPTS="${FZF_CTRL_T_OPTS//--height[=[:space:]][1-9][0-9]?/ }"
export FZF_CTRL_R_OPTS="${FZF_CTRL_R_OPTS//--height[=[:space:]][1-9][0-9]?/ }"
export FZF_ALT_C_OPTS="${FZF_DEFAULT_OPTS} --preview='tree.com //F {} | tail +3 | head -\$LINES'" Ideally, of course, the issue with setting |
You can just append export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --no-height" |
Thank you, I was not aware of it. This is more robust. Ideally, since the provided bash scripts set their own custom parameters, add a check for Git Bash, say by |
I can confirm that |
Yes, you can inspect here: __fzf_defaults() {
# $1: Prepend to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS
# $2: Append to FZF_DEFAULT_OPTS_FILE and FZF_DEFAULT_OPTS
echo "--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore $1"
command cat "${FZF_DEFAULT_OPTS_FILE-}" 2> /dev/null
echo "${FZF_DEFAULT_OPTS-} $2"
}
__fzf_select__() {
FZF_DEFAULT_COMMAND=${FZF_CTRL_T_COMMAND:-} \
FZF_DEFAULT_OPTS=$(__fzf_defaults "--reverse --walker=file,dir,follow,hidden --scheme=path" "${FZF_CTRL_T_OPTS-} -m") \ |
For me unability to input non-latin characters was introduced in 0.54, 0.53 works fine. |
Did you try #3799 (comment) ? |
Now I did, with no result. Will stick to 0.53 for a while. |
If you're experiencing a change of behavior in 0.54.0, this might be the cause. See #3847 (comment) I'll look into it when I get some time. |
I can confirm that the LightRenderer for Windows written by @kelleyma49 cannot take Unicode characters. Lines 58 to 62 in 2dbc874
When I type in a Unicode character, it reads it as |
Ideally, we should fix LightRenderer to support non-ASCII input, but I don't have the Windows expertise to do that, so I'm going to revert the decision I made in 0.54 to prefer LightRenderer over tcell-based renderer for now. Related: |
I believe I have a fix for reading and displaying non-ASCII input. Please see #3951 |
ReadConsoleW is the way to read Unicode input, accepting it as UTF16 which is the native Windows encoding for Unicode and is available starting in Windows NT and XP (so it's available in all currently supported versions of Windows). Console Input Buffer has some info on how the input buffer works. To read the full range of Unicode, surrogate pairs have to be handled. For example, code can't simply convert each UTF16 character individually into UTF8, because surrogate pairs are only a UTF16 encoding concept. Code needs to be aware of when a leading surrogate has been input, and then get the trailing surrogate and then convert them as a string from UTF16 to UTF8. Or convert them to UTF32 and then to UTF8. Clink has some C++ code for handling surrogate pairs and converting from UTF16 to UTF8 for input here. Review that whole file for more context on reading full Unicode input in a Windows console. (Note that the mouse support doesn't generate proper ANSI escape codes for mount input -- it generates private internal-only custom escape codes for mouse input.) |
Checklist
man fzf
)Output of
fzf --version
0.52.1 (6432f00)
OS
Shell
Problem / Steps to reproduce
Specifically I use bash from git for windows.
OS: Win 10
Terminal:
When I hit CTRL+T and try to input greek characters they appear in the prompt either transliterated to their equivalent ascii (eg
α
becomesa
) or printed as the?
character.This happens with both terminals.
Both terminals are able to print greek characters (eg
ls
a folder with greek filenames) and are able to take greek input in their prompts. So the issue is with fzf's prompt.The text was updated successfully, but these errors were encountered: