3 ms·
I switched over to zsh a few months back and picked up something like this method: https://gist.github.com/zulhfreelancer/9c410cad5efa9c5f7c74cd0849765865 https
by awinder 7y ago
I switched over to zsh a few months back and picked up something like this method: https://gist.github.com/zulhfreelancer/9c410cad5efa9c5f7c74cd0849765865 https://gist.github.com/zulhfreelancer/9c410cad5efa9c5f7c74c.... This is nice to see for bash and I definitely agree on the usefulness notes, it’s been a nice improvement / helped me not get confused a few times
- mikelward 7y agoIsn't that printing the time the prompt was printed (the time the previous command finished)? This is printing the time you pressed Enter (the time the command started), which is harder and less common, since that's not when the prompt is printed.
- mikelward 7y agoThis is one way you could do something similar in zsh: https://stackoverflow.com/a/17915260/102182 https://stackoverflow.com/a/17915260/102182
- countermeasure 7y agoIt looks like zsh can handle updating the time in the prompt quite simply and elegantly.
- mikelward 7y agoYes, I find that solution much simpler.
- Symbiote 7y agoIt keeps the clock up-to-date, but I use Konsole's "monitor for activity" feature, which changes the colour of inactive tabs if there is output. Instead, this seems to work: TRAPDEBUG() { case "$WIDGET" in zle-line-finish) zle reset-prompt ;; *) ;; esac } (I don't know if further cases will be required.) This updates the prompt after "enter" is pressed, but before the command is executed.