-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Trailing newlines not getting stripped from items #4282
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
Comments
There was a regression. Does e4489dc fix the problem? |
fzfghost-an.mp4Here is a reproducing command for the first item being truncated: for _ in $(seq 19); do printf "foo\nbar\0"; done | ./fzf --read0 Change 19 so that the items no longer fit on screen. |
I think the new behavior is correct here. fzf shouldn't trim the trailing new line without user's consent. The second issue needs to be fixed, I'll look into it for _ in $(seq 5); do printf "foo\nbar\0"; done | fzf --read0 --height 11 --bind load:last EDIT: Let me correct myself. I'll review your patch. |
Can you show me the command you used here? |
The command is massive because I wanted to support a bunch of weird edge-cases. It relies on: |
I don't disagree with this and I can easily just printf "foo\n\e[0m\0bar\n\e[0m\0baz\n\e[0m\0" | ./fzf --read0 --ansi --with-nth .. printf "foo\n\0bar\n\0baz\n\0" | ./fzf --read0 --with-nth .. printf "foo\n\0bar\n\0baz\n\0" | ./fzf --read0 It seems weird to me that a trailing newline will be stripped as long as ANSI escape sequences like |
Two things.
|
It worked before by calling the now removed |
Good point. It was removed while implementing |
So TrimTrailingWhitespaces is back. Although the question of whether we should remove the trailing new lines or not in multi-line mode remains, we're back to the old behavior. |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [junegunn/fzf](https://github.com/junegunn/fzf) | patch | `v0.60.2` -> `v0.60.3` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>junegunn/fzf (junegunn/fzf)</summary> ### [`v0.60.3`](https://github.com/junegunn/fzf/releases/tag/v0.60.3): 0.60.3 [Compare Source](junegunn/fzf@v0.60.2...v0.60.3) - Bug fixes and improvements - \[fish] Enable multiple history commands insertion ([#​4280](junegunn/fzf#4280)) ([@​bitraid](https://github.com/bitraid)) - \[walker] Append '/' to directory entries on MSYS2 ([#​4281](junegunn/fzf#4281)) - Trim trailing whitespaces after processing ANSI sequences ([#​4282](junegunn/fzf#4282)) - Remove temp files before `become` when using `--tmux` option ([#​4283](junegunn/fzf#4283)) - Fix condition for using item numlines cache ([#​4285](junegunn/fzf#4285)) ([@​alex-huff](https://github.com/alex-huff)) - Make `--accept-nth` compatible with `--select-1` ([#​4287](junegunn/fzf#4287)) - Increase the query length limit from 300 to 1000 ([#​4292](junegunn/fzf#4292)) - \[windows] Prevent fzf from consuming user input while paused ([#​4260](junegunn/fzf#4260)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xODUuMCIsInVwZGF0ZWRJblZlciI6IjM5LjE4NS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Checklist
man fzf
)Output of
fzf --version
0.60 (devel)
OS
Shell
Problem / Steps to reproduce
Since commit 84e2262#diff-37113d7d967fa0fd21c0250890d9cda61c7d2591eeedd43017e9e7bc471b432aL138, newlines are no longer stripped from the end of each item when there are extra bytes (such as ANSI escape sequences) after the newline.
Before 84e2262:
fzfbefore-an.mp4
After:
fzfafter-an.mp4
Also, if you look at the after video I am moving back and forth between the first and second item and when I am focused on the second item the first item is no longer shown.
Here is a simple reproducing command:
Before 84e2262:
After:
I will also try and find a reproducing command for the first item not showing.
The text was updated successfully, but these errors were encountered: