Skip to content
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

History limited to command written #3614

Closed
00sapo opened this issue Jun 14, 2021 · 13 comments
Closed

History limited to command written #3614

00sapo opened this issue Jun 14, 2021 · 13 comments
Labels
line editor Issues related to reedline Stale used for marking issues and prs as stale

Comments

@00sapo
Copy link

00sapo commented Jun 14, 2021

In Fish, Xonsh, and many other shells, when pressing arrows up/down for navigating through history, the user only sees commands that share the part of the command already written.

E.g.

$ ffmpeg -i file.ext -o file.out -a -long -list -of -options
[...]
$ ls ~/Develop/
[...]
$ many
[...]
$ other
[...]
$ commands
[...]
$ ffmpeg <arrow-up>

when pressing , the user should see ffmpeg command and the intermediate commands (ls etc.)

@fdncred
Copy link
Collaborator

fdncred commented Jun 14, 2021

We've been trying to get rustyline to support such a thing as is documented in the PR that @oberien pushed over a year ago. kkawakam/rustyline#424

@oberien
Copy link

oberien commented Jun 14, 2021

This issue is probably a duplicate of #465, the original issue I wrote the PR to rustyline for. If you want this feature, you could use my fork of nushell from this PR which includes the rustyline version with that PR. I only update the fork once in a blue moon though currently.

@github-actions
Copy link

This issue is being marked stale because it has been open for 30 days without activity. If you feel that this is in error, please comment below and we will keep it marked as active.

@github-actions github-actions bot added the Stale used for marking issues and prs as stale label Jul 15, 2021
@oberien
Copy link

oberien commented Jul 24, 2021

Not stale.

@fdncred fdncred removed the Stale used for marking issues and prs as stale label Jul 24, 2021
@fdncred
Copy link
Collaborator

fdncred commented Jul 24, 2021

agreed. what's the latest on this @oberien ?

@github-actions
Copy link

This issue is being marked stale because it has been open for 90 days without activity. If you feel that this is in error, please comment below and we will keep it marked as active. Otherwise, it will be closed in 10 days.

@github-actions github-actions bot added the Stale used for marking issues and prs as stale label Oct 23, 2021
@sigmaSd
Copy link

sigmaSd commented Nov 21, 2022

I think now nushell uses reedline, is that feature available there ? personaly I can't replace fish because of these kind of details

@sigmaSd
Copy link

sigmaSd commented Nov 21, 2022

Actually it seems to be implemented now, but it works only if the commands share the starting part, fish doesn't have this limitation

@fdncred
Copy link
Collaborator

fdncred commented Nov 21, 2022

@sigmaSd how should it work? I don't know what you mean where you say, "but it works only if the commands share the starting point". can you give examples of what this means please?

@sigmaSd
Copy link

sigmaSd commented Nov 21, 2022

if you have cd hello on your history, now you type hello and then up, fish will give you that entry while nu won't

This is the same case btw in tab completion, if you have a directory called ab in fish you can press b then tab to get that directory, in nu you have to give the same start so only a works

@oberien
Copy link

oberien commented Nov 21, 2022

The current implementation in nu is similar to the one in zsh. In zsh it's prefix-matching from the start of the line to the current cursor position. The main difference is that in zsh the cursor stays in the same position when arrowing-up through the history while in nu (last I checked) the cursor is moved to the end when a new command is shown (though further searches still use the same prefix).

@sigmaSd
Copy link

sigmaSd commented Nov 21, 2022

In that case I guess this issue can be closed

@sholderbach sholderbach added the line editor Issues related to reedline label Nov 21, 2022
@sholderbach
Copy link
Member

Happy to take (reedline) PRs that give our history traversal and completions options to be closer to fish's magic.
We currently have the base logic via common prefix search but are certainly open to make more users happy :)

In my mind the core of this issue is implemented and thus would agree to close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
line editor Issues related to reedline Stale used for marking issues and prs as stale
Projects
None yet
Development

No branches or pull requests

5 participants