Last active
July 2, 2020 08:15
-
-
Save watain666/9492c3ca28b23f7a5061247075c7a6b5 to your computer and use it in GitHub Desktop.
Add current date/time to clink/cmder prompt. Ref: https://superuser.com/a/1192357/916566
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_prompt() | |
cwd = clink.get_cwd() | |
prompt = "\x1b[1;32;40m{cwd} {git} {hg}\x1b[1;30;40m{time}\n{lamb} \x1b[0m" | |
new_value = string.gsub(prompt, "{cwd}", cwd) | |
add_time = string.gsub(new_value, "{time}", os.date("%x - %X")) | |
clink.prompt.value = string.gsub(add_time, "{lamb}", "λ") | |
end | |
clink.prompt.register_filter(custom_prompt, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment