The other day I was curious if I could add the current timestamp to my eshell prompt. After some Kagi‘ing I found this page and started writing my own prompt! (Using the example under “A fancy prompt” as a starting point.)
Here’s my config, which you can use as a jumping-off point.
Note about the format
Note that if you want
the author suggests binding to
M-}) to keep working, you need a
space before the
$ symbol in your prompt.
If you want to change this format, you can still edit the regex that eshell uses
to find the prompts. The helpdoc for
eshell-prompt-function says as much:
Make sure to update ‘eshell-prompt-regexp’ so that it will match your prompt.
As I was writing this post I found out about this project. Looks like it doesn’t support timestamps though, and not sure if it gives you much fine-grained customization.