clock-tui icon indicating copy to clipboard operation
clock-tui copied to clipboard

Request: Output TUI to stderr to allow piping of stopwatch data

Open Craige opened this issue 6 months ago • 2 comments

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.

Craige avatar Aug 21 '25 17:08 Craige

Why stderr and not /dev/tty?

lolbinarycat avatar Aug 24 '25 20:08 lolbinarycat

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.

Craige avatar Aug 25 '25 13:08 Craige