Update prompt regularly #341
-
Hi, the terminal emulator of my choice ( I can use bleopt prompt_status_line='\r\r\t'
bleopt prompt_status_align=$'justify=\r' to show the time stamp, but it's not refreshing every second. Any way to implement such feature? Or would I need to use some additional tooling like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
This is an example (You need Bash 4.0+): # blerc
ble/util/idle.push 'ble/util/idle.sleep 1000'
function ble/prompt/backslash:killermoehre/time {
ble/prompt/unit/add-hash '$SECONDS'
ble/prompt/process-prompt-string '\t'
}
bleopt prompt_status_line='\r\q{killermoehre/time}'
bleopt prompt_status_align=$'justify=\r'
|
Beta Was this translation helpful? Give feedback.
This is an example (You need Bash 4.0+):
ble/prompt/unit/add-hash '$SECONDS'
instructs that the prompt content should be invalidated when the Bash built-in shell variableSECONDS
is changed.ble/util/idle.push 'ble/util/idle.sleep 1000'
is an empty timer loop to induce an update if any of the UI elements is invalidated.