In the last episode (Jul 23), Martin Baehr said:
arguably the added newline produces nicer output, supporting the current expectation that each readline->write starts at the beginning of the line, but writing something without a newline in the end is usually intentional, so adding a newline would break that.
currently it is not possible to write something without a newline because it would be overwritten, so this is only talking about future applications.
consider hilfe: with a newline the results of this:
write("foo");
foo (1) Result: 3
write("foo\n");
foo (1) Result: 4 would be indistinguishable (except for the value write returns)
with removing the clear it would instead be:
write("foo");
foo(1) Result: 3
this may be considered ugly but would somehow be more correct.
A few years ago zsh added a nice feature where it sends the following string just after a command exits and before printing its prompt:
<bold><standout>%<endbold><endstandout><COLS-1 spaces><CR>
If the previous command printed a partial final line, you would end up seeing a bold inverse % at the end of the output, and the shell prompt on the next line. If the command did exit with a newline as the last output character, the % gets overwritten with the shell prompt so you don't see it.
http://zsh.cvs.sourceforge.net/zsh/zsh/Src/utils.c?revision=HEAD&view=ma...