hledger icon indicating copy to clipboard operation
hledger copied to clipboard

hledger-ui should be able to read standard input

Open simonmichael opened this issue 6 years ago • 2 comments

This should work:

~/src/hledger$ echo $TERM
xterm-256color
~/src/hledger$ cat examples/sample.journal | hledger-ui -f-
hledger-ui: getTerminalAttributes: invalid argument (Bad file descriptor)

simonmichael avatar Dec 02 '17 19:12 simonmichael

Clarifying: hledger-ui is interactive, but it seems to me it should be able to read data from a redirected stdin, then run the normal interactive UI. Converting to a wish.

simonmichael avatar May 05 '23 21:05 simonmichael

To redirect something to stdin, and then run interactively, you could run something like

cat file.txt - | hledger-ui -f-

(the second argument to cat, -, would tell cat to copy stdin after it got to the end of file.txt) But it looks like this program tries to interact with the terminal as a terminal file, not just basic line-based IO that would work easily from a pipe...

derelbenkoenig avatar Nov 14 '23 20:11 derelbenkoenig