petobens / trueline

Fast and extensible bash powerline prompt with true color and fancy icon support
MIT License
385 stars 36 forks source link

last command duration #24

Closed yousefvand closed 3 years ago

yousefvand commented 4 years ago

Last command execution time. Feel free to modify the PR.

cmd-duration

petobens commented 3 years ago

Sorry for the long overdue review. Thanks for your interest in trueline. I've modified the PR slightly (mostly to account for shellcheck/shformat standards and fix merge conflicts). One thing that bothers me is that if I exit the bash prompt with exit command then trueline leaves undeleted files in the /tmp dir. Is there any way to fix this? If the answers is no then maybe using this approach https://github.com/chris-marsh/pureline/blob/main/segments/duration_segment might be worth exploring?

yousefvand commented 3 years ago

The provided link is a clear cut implementation of the same concept. My implementation leaves small files in /tmp in your use-case which is ok IMO since /tmp would be cleared on each system boot.

petobens commented 3 years ago

I was asking whether you can modify the pr so as to remove such files upon exiting (afaict those file do get removed whenever the segment is generated).

petobens commented 3 years ago

Merged. Thanks for the work and once again I apologize for my delayed review.

yousefvand commented 3 years ago

You're welcome, thanks for your lightweight and modular powerline solution.