-
Notifications
You must be signed in to change notification settings - Fork 8.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
Add "recent commands" to Command Palette in commandline mode #8317
Conversation
@zadjii-msft - this is how it behaves. Hope you like it 😊 |
25b2c14
to
01ec21d
Compare
Oh my gosh you can search and filter them? |
Absolutely. Even mark them bold 😛 |
i love this |
It's just so crisp |
@zadjii-msft - do you want review this one? I could add a setting for history size, but probably let's start with validating the basic functionality? |
I really do, I'm just neck-deep in another investigation ATM that's taking 99% of my brain cycles. This is probably the next PR I review though |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this was all so incredibly straightforward, I love it. I suppose 10 is a perfectly reasonable history size to start with - I'll be stunned if anyone hits that in a single session before we add #8324. And increasing the size with a setting wouldn't be that hard - but yea, let's wait till someone wants a longer history
Great idea & implementation!
{ | ||
_commandLineHistory.RemoveAtEnd(); | ||
} | ||
_commandLineHistory.InsertAt(0, filteredCommand.value()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you run the same command multiple times, will it keep getting added to the history? Should we try and de-duplicate entries in the history? (that is probably fine for a follow-up PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zadjii-msft - I took this approach because I didn't know what is the best behavior here, and in such cases I choose the simplest one. The options I considered were:
- Set, sorted alphabetically
- Set, sorted by MRU
- List, sorted by MRU
- A combination that you mentioned of don't push the command if it equals to the previous one
If you have a strong feeling about one of those, I can change this now or in followup (or we can add configs and leave to the user).
@DHowett - bumping this for the case you want to give me a homework for the long week-end 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clever asf. love it.
I'm okay not doing this for now or going back and filing a followup 😄 Thanks again, this is lovely. |
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
Summary of the Pull Request
Add a history to command palette in the command line mode.
Few considerations/limitations
PR Checklist
Validation Steps Performed