Is there some way to have the pipe/tee/write combo write lines immediately? ... if it can be done, what is the trade-off?
My script sends a keypress to the terminal, which is running
That keypress causes
app to write a marker to its log.
The log is the app's normal screen output (timestamped lines).
The log is being written via
| tee -a log
The marker marks the line I want; ie. the timestamped line before the marker.
The problem is that when I then immediately search the log (using
sed from the same script), it sometimes returns a previous marker, ie. the most recent marker has not been written to the log yet.
I assume this is a buffering issue, but I'm in unknown territory with that.
Not sure if it matters: The script is
elisp. The terminal is
emacs terminal emulator with a