akinomyoga / ble.sh

Bash Line Editor―a line editor written in pure Bash with syntax highlighting, auto suggestions, vim modes, etc. for Bash interactive sessions.
BSD 3-Clause "New" or "Revised" License
2.72k stars 86 forks source link

fzf Ctrl+W is not recognized #259

Closed SuperSandro2000 closed 1 year ago

SuperSandro2000 commented 1 year ago

ble version: 0.4.0-devel3+88e74cc Bash version: 5.1.16(1)-release (x86_64-pc-linux-gnu)

ble/widget/display-shell-version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu) [NixOS 23.05 (Stoat)]
ble.sh, version 0.4.0-devel3+88e74cc (noarch) [git 2.38.1, GNU Make 4.3, GNU Awk 5.1.1, API: 3.1]
bash-completion, version 2.11 (hash:d0e5648ad55343dd48150ee14f1be0262607dff8, 76396 bytes) (noarch)
fzf key-bindings, (hash:dd5b0fc0406c669fe603ee347101fbe981a6cb71, 3996 bytes) (noarch)
fzf completion, (hash:51687a081dd5720baab7c1e222b71560c070d8c6, 10202 bytes) (noarch)
sbp, version +f78e781f (noarch), hooks(), left(), right()
romkatv/gitstatus, (hash:c776c3bb655c95d7d33399335d7a3f3cc52a1712, 19435 bytes) (noarch)
locale: LC_COLLATE=en_US.UTF-8 LANG=en_US.UTF-8 LC_MEASUREMENT=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_NUMERIC=en_US.UTF-8 LC_TIME=en_US.UTF-8
terminal: TERM=wezterm wcwidth=15.0-west/15.0-2+ri, unknown:- (1;277;0)

Opening fzf with Ctrl+R and then hitting Ctrl+W produces ;5;119~. Works in normal terminal input and when detaching blesh. I am using fzf version 0.35.1.

akinomyoga commented 1 year ago
fzf key-bindings, (hash:dd5b0fc0406c669fe603ee347101fbe981a6cb71, 3996 bytes) (noarch)
fzf completion, (hash:51687a081dd5720baab7c1e222b71560c070d8c6, 10202 bytes) (noarch)

These lines indicate that the integration code with the fzf settings is not properly loaded. The fzf settings need to be used with the integration setting. How did you configure fzf?

Edit: If the integration code is correctly loaded, the above information should be suffixed by (integration: on) as

fzf key-bindings, (hash:e10117e3976d2818c6a30f233916377bbc08795c, 3767 bytes) (noarch) (integration: on)
fzf completion, (hash:21aa45053248b3c7049eb84567db3d31d9d11867, 10052 bytes) (noarch) (integration: on)
SuperSandro2000 commented 1 year ago

How did you configure fzf?

I didn't configure anything. Before I just sourced fzf normally and it happened to work.

The example in https://github.com/akinomyoga/blesh-contrib/#option-1-setup-in-fzfbash didn't work for me because I setup fzf in .bash_completions instead of .bashrc which gets loaded on my system before the users .bashrc.

After fixing this and seeing the integration loading like it should in the widget, Ctrl+W still does not work. I verified that by sourcing blesh with --noattach, testing Ctrl+W in fzf and then attaching to fzf when Ctrl+W broke. The same happens when opening a new terminal tab and loading blesh straight away. I also tried deleting the blesh cache under .cache and that did not help.

GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu) [NixOS 23.05 (Stoat)]
ble.sh, version 0.4.0-devel3+88e74cc (noarch) [git 2.38.1, GNU Make 4.3, GNU Awk 5.1.1, API: 3.1]
bash-completion, version 2.11 (hash:b197e6e944ae174cad7b6ddc704bcce17c5f7da5, 76396 bytes) (noarch)
fzf key-bindings, (hash:d85105c9729365fc2b42c84204e3bd206b59cb03, 3996 bytes) (noarch) (integration: on)
fzf completion, (hash:51687a081dd5720baab7c1e222b71560c070d8c6, 10202 bytes) (noarch) (integration: on)
sbp, version +f78e781f (noarch), hooks(), left(), right()
romkatv/gitstatus, (hash:c776c3bb655c95d7d33399335d7a3f3cc52a1712, 19435 bytes) (noarch)
locale: LC_COLLATE=en_US.UTF-8 LANG=en_US.UTF-8 LC_MEASUREMENT=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_NUMERIC=en_US.UTF-8 LC_TIME=en_US.UTF-8
terminal: TERM=wezterm wcwidth=15.0-west/15.0-2+ri, unknown:- (1;277;0)
akinomyoga commented 1 year ago

Thank you! I could reproduce the problem in my environment so fixed it in commit 486564a. This was an issue caused by the output buffering of the terminal escape sequences. I just added flushing.

SuperSandro2000 commented 1 year ago

Thanks! Seems to work now like it should.