Windows – How to add current date/time to clink/cmder prompt

clinkcmdercommand linewindows

I'm a rather happy user of clink via the great cmder package. The only thing I miss is an easy way to set the command prompt to display the current date/time (and last exit code, history number, as in bash… etc).

Could someone point me to the right direction on how to do this?

Best Answer

Try this prompt settings (example only, it's show how you can call any console application inside "prompt printing"). Note! It works in ConEmu only.

prompt $p$s$e]9;7;"cmd /c echo (%DATE% %TIME%)"$e\$g

But, as Bob said, there is an easier way:

prompt $p$s$d$s$t$s$g

And for cmder you should edit the supplied init.bat as that defines the prompt settings.

Related Question