diff options
author | Kerin Millar <kfm@plushkava.net> | 2024-05-14 09:33:09 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-05-15 11:28:30 +0100 |
commit | f3e254127ebad7c8774081e3834653effe1966d0 (patch) | |
tree | 53ab25b461b251703e73c740ffeb0ba8059c116c /Makefile | |
parent | meson.build: prepare for gentoo-functions-1.1 (diff) | |
download | gentoo-functions-f3e254127ebad7c8774081e3834653effe1966d0.tar.gz gentoo-functions-f3e254127ebad7c8774081e3834653effe1966d0.tar.bz2 gentoo-functions-f3e254127ebad7c8774081e3834653effe1966d0.zip |
Have _eend() remember the cursor position before printing
The act of printing a LF character after the indicator moves the cursor
back to the row beneath - as intended - but also results in the cursor
being positioned at the first column, even though it may have been
elsewhere initially. Address this by using the DECSC sequence to save
the cursor position prior to printing the indicator, then the DECRC
sequence to restore it afterwards. My testing shows no measurable
performance impact.
Consider the following script as a test case.
#!/bin/sh
. ./functions.sh
ebegin Testing
einfon more output
eend 0
Below is a depicted invocation which clearly demonstrates the beneficial
effect of this change.
$ /.testcase; printf done
* Testing ... [ ok ]
* more outputdone$ ▉
Whereas, previously, the outcome would have been as shown below.
$ /.testcase; printf done
* Testing ... [ ok ]
done$ ▉ output
Signed-off-by: Kerin Millar <kfm@plushkava.net>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions