Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How to add two empty lines before and after output (stdout) of any command?



Bart Schaefer wrote:
> On Aug 23,  9:16am, Y@R wrote:
> }
> } Is it possible to solve this problem?
> 
> The short answer to this is "no."
> 
> The long answer is that in general the shell doesn't have any idea what
> (or if any) output a given command produces.  For external commands,
> the shell completely surrenders control of the terminal and waits for
> the command to finish; it can't tell what happens to the display in
> the interim.

Hmm... now you've spelled out the problem, it reminds me that there are
ways of prodding certain sorts of terminal including xterm into
reporting the cursor position.  If you do this before and after, you can
guess what's happened, although there are numerous cases (e.g. right at
the bottom of the screen) where this isn't good enough.  Then you have
to start looking at what characters are on the screen.  I suspect this
isn't going anywhere.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


.



Messages sorted by: Reverse Date, Date, Thread, Author