]> git.lizzy.rs Git - linenoise.git/commit
Bug fix. Fix fallback code for getting the terminal width.
authorAndreas Kupries <andreask@activestate.com>
Fri, 18 Oct 2013 20:43:06 +0000 (13:43 -0700)
committerSteve Bennett <steveb@workware.net.au>
Mon, 21 Oct 2013 01:03:40 +0000 (11:03 +1000)
commit24186e9905a1d686516359b02551a9c887a7de3b
tree83dc241ddcdc2e4a2b8a88b01e2c4eadba17f55d
parentd0b3b36a72dcd058687b0018f2b4b82d21e768bb
Bug fix. Fix fallback code for getting the terminal width.

When using vt100 control sequences, do not change the visible cursor location.
Instead of
- go far right
- query location
we now do
(1) query location
(2) go far right
(3) query location again
(4) move left to the original location as reported by (1).

Only if (1) succeeds and (3) fails will the visible cursor location change (moving to far left).
Placed the code to request cursor location and parse the response into its own helper function.

The old way of doing it left the cursor at far right, and could mess up an outer shell prompt.
linenoise.c