-
Notifications
You must be signed in to change notification settings - Fork 178
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
Show last run time for each command #149
Conversation
src/history/history.rs
Outdated
@@ -244,13 +245,27 @@ impl History { | |||
|
|||
like_query.push_str("%"); | |||
|
|||
let query = "SELECT id, cmd, cmd_tpl, session_id, when_run, exit_code, selected, dir, rank, | |||
let query = "WITH matched_commands AS ( | |||
SELECT id, cmd, cmd_tpl, session_id, when_run, exit_code, selected, dir, rank, |
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.
Does using this when_run
not work, such that you need to do the second query? If this isn't the most recent, maybe when the contextual_commands temp table is made, it should be MAX(when_run)
?
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.
There would need to be at least two queries here to get the max grouped only by cmd
but on looking temp table creation is a much better place for this!
Could we make it use less space by just showing |
I've liked having days-hours and hours-minutes resolution in my test-driving so far, so I may have sold it a bit short with the recent git commands. That said, other scales are definitely not as useful, so that specific band really has to be worth the four characters. Try it out for a day or three and see what you think, maybe? |
Ok! |
I don't mind the two part dates, but I am finding it a bit hard to parse when I skim the list. I wonder if we should make it a lighter color (on dark backgrounds) and put it flush to the right? |
here's a version with timings on the right. The FixedLengthGraphemeString looks like it only checks on input and returns whatever the internal string has accumulated (even if shorter), though, and I'm not quite sure what to do about that. We have |
I'm not 100% sure what you're asking. If you need to know if the line is currently selected in Do you like how it looks if you put
on line 248? |
I was trying to fill the remaining width between command text and timing info with spaces and not having much luck. |
Thanks @dmfay, this is a nice addition :) |
with thanks to atuin for the idea of showing timing!