-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Mimicing Zsh behavior of nsearch (non-incremental prefix search) #101
Comments
Thank you for your suggestion! This is related to the discussion in #80 with @Alyetama yesterday. I'm now thinking of adding a new bleopt option
OK, I'll consider an option for it. Actually, the purple "matched part" is highlighted as the current selection, so if the cursor position is simply moved to the end of the line, the entire line would be highlighted while
Actually, the current behavior is the imitation of Bash's behavior, but I agree that the behavior is not so friendly, so I'll consider the change. I'm recently a kind of busy, so may take some time. There are several pending fixes of |
That sounds like a great idea (I personally prefer the 3rd and 4th opts).
I think highlighting only the matched part would be more preferable. Highlighting the entire line would give the (false) impression that the entire line is being used in the search. Actually, I sometimes use PowerShell too, and PowerShell's behavior exactly matches Zsh's behavior - searching using only the substring upto the current cursor position, but also moving the cursor to the end when browsing through the matches.
Thank you, that'll be awesome!
Please take your time! There's no hurry (from my side 😊). Good things do take time. Thanks again for ble.sh!!! |
I don't know if it's apparent from the Zsh GIF, but there's one more tiny detail: pressing Enter on any search item in Zsh straight up runs that command, whereas on ble.sh you have to press Enter twice (one to accept the search item, one to run it). The Zsh behavior is more seamless, in this case |
That's also discussed in #80 (comment), but it's intentional. If you want to immediately run the command, you can press C-j or C-RET. You can change the keybinding using |
I tried to issue this command but it didn't work, am I doing this wrong? I also tried |
As written in Manual §3.1/¶5,
In terminals, raw bytes \000-\037 are used to encode C-@-C-_, so the "key RET" is usually transferred as C-m by the terminal unless your terminal explicitly encodes RET using the special key sequences of ble-bind -m 'nsearch' -f 'C-m' 'nsearch/accept-line'
ble-bind -m 'nsearch' -f 'RET' 'nsearch/accept-line'
ble-bind -m 'nsearch' -f 'C-[' 'nsearch/cancel'
ble-bind -m 'nsearch' -f 'ESC' 'nsearch/cancel' When you want to bind a widget to C-[ ( If you want to distinguish RET from C-m and assign different keybindings, you may use a terminal that sends distinct sequences of RET in §3.6 |
Wow, thanks for such a detailed answer.
Thanks, will keep that in mind.
For the most part, I'm using Windows Terminal, and as far as I know, there's no way to set key sequences in it yet. |
New options for
|
Beautiful! Can't thank you enough... Should I close this then? |
OK! Thank you! I'll close it. |
Hi,
Thanks for the great project!
I'd like to move away from Zsh, so ble.sh sounds very promising. However, I would like to mimic Zsh's default history searching behavior in ble.sh. See below:
(type the beginning of your command, and press Up/Down to browse the history lines that begin with the substring I type)
Below is the default behavior of ble.sh in bash:
I would like to make it like Zsh. Specifically, I would like to:
nsearch
info below my promptI have put the following lines in my .bashrc
Any help would be appreciated.
Thanks in advance!!!
The text was updated successfully, but these errors were encountered: