On Tue, Feb 04, 2014 at 09:14:52AM +0000, Philip Martin wrote: > We want some pattern that ensures __close is always called even when an > error is returned part way through. Either a pool cleanup or some sort > of __with_pager(). Otherwise we have to ensure that none of the error > pass bypass __close, e.g. > > PAGER=less svn diff wc file:/// > > leaves me needing to reset my terminal.
That's interesting. It seems whether a terminal reset is needed depends on the pager, because I don't see this issue with OpenBSD's less(1). What I do see is that the error message raised by 'svn diff' ("Unable to open repository 'file://'") does not appear consistenly. There seems to be a race between svn and the pager. And if I set PAGER="less -F" and run a command which produces output that does not fill the terminal completely I don't see any output at all. It seems the pager decides to exit immediately and we're writing to a dead fd instead of stdout. I'm not sure what to do here. However, piping svn's output to 'less -F' shows the same behaviour, so perhaps there is nothing we can do about this.