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

Re: prompt and prompt_cr option



On Sat, 9 Oct 2004, Jordan Breeding wrote:

> Is there a way to force zsh to check to see if the last character that 
> was printed was a newline and if it wasn't to just print one before it 
> issues the carriage return?

No.  There's no way, in general, for zsh to know what characters were 
previously output to the terminal (or for any process to know what any 
other process has done with a shared device).

For certain types of terminals you might be able to query the current 
cursor position and do something clever when it is not in column zero, but 
it's been deemed more trouble than it's worth to have ZLE attempt to 
determine whether the terminal has support for this and then to make use 
of that information.  (Querying the terminal involves sending a control 
string and then reading back a response, which is unreliable because it 
can be garbled by user type-ahead or other interference.)



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