msteveb/linenoise — pull request #13 by andreas-kupries (2013-10-18 21:06:08+00:00)
Title: Mainly bug fixes (It also has the hidden input for passwords, sorry)

The important parts are the Oct 18 bugfixes below.
(1) Fix an uninitialized current->cols

This happens when both stdin and stdout are redirected. It expressed itself as linenoiseColumns() returning a wholly bogus terminal width == the uninitialized field.

(2) Reworked the unix getWindowSize() to not change the visible cursor location when it has to use vt100 sequences to determine the terminal width.

The current setup moves the cursor to the right, then queries. This leaves the cursor at the right, which can mess up outer processes, like a shell. I.e. what was seen was the next shell prompt starting at the far right and wrapping into the next line. This looked as if the first character of the prompt was missing, while it was indeed visible, up one line at the right edge of the terminal.

The modified code instead does
- queries current location => here
- moves to far right
- queries location => width
- moves back to "here".

With apologies, as this is done off my master it also has the changes enabling a "hidden" input mode for password entry. IIRC you rejected these for your repository.

This means that while the merge is technically clean for automatic merge in practice it is not and requires work to take only changes b0ba152 and 9e25655.

I have no idea how I could make a pull request just for these two commits.