radian
radian copied to clipboard
Add Timestamp to Radian Prompt
Hi there, I'm trying to figure out of it is possible to add a timestamp to the prompt. I tried adding one via my .Rprofile
, but that broke a lot of great radian functionality, so now I'm looking at configuring options(radian.prompt)
in radian_profile
.
It looks like the default string specifies bash colors, so I'm guessing the syntax for customizing the radian prompt is similar to a bash prompt. According to this site, it looks like inserting \D{%H:%m:%s}
or %T
should add a timestamp to a bash-style prompt. However, adding that to the profile string like: "\033[0;34mr$%T>\033[0m "
just gives me a prompt that looks like [ins] r$%T>
.
Is there a specific type of prompt syntax that radian uses? Are there different escape characters I should look into?
Thanks for the help, and the great console.
You could set options(radian.prompt = paste(Sys.time(), "\033[0;34mr$>\033[0m ", sep = " "))
in radian_profile
.
Thank you!
So, the approach recommended by @meriops does not seem to update the time, the prompt is just frozen with the time at which the R session was started.
Ha yes, this is static of course... Stupid me. Sorry about that...
basically, we will need to set refresh_interval
of prompt-toolkit
to a non zero value and have a mechanism to render arbitrary information in the prompt.