clock-tui
clock-tui copied to clipboard
Request: Output TUI to stderr to allow piping of stopwatch data
Title says it all. Can we output the TUI to stderr so that the stopwatch data can be collected/piped upon completion (as described here.
E.g.
# This is probably overly verbose/complicated
tclock stopwatch | grep -o "\([[:digit:]]\{1,2\}:\)\{1,2\}[[:digit:]]\{1,2\}\(\.[[:digit:]]\)\{0,1\}" | awk '{ print "- Log item duration: " $0 }' >> some_log.log
I can create a PR for this if interested.
Why stderr and not /dev/tty?
Good question!
Originally I figured it would be TTY as well, but when searching the Ratatui documentation I found the section linked above.
I think part of the reason is the simplicity of maintaining cross-platform code, as Windows would be something else (CON?), and something else again if running a different shells like PuTTY. Beyond that, I can't really say why they suggested stderr over TTY.