On Monday 19 July 2010 00:05, Christopher Barry wrote:
> On Sun, 2010-07-18 at 21:55 +0200, Denys Vlasenko wrote:
> > On Saturday 17 July 2010 19:12, Christopher Barry wrote:
> > > All,
> > >
> > > looking for an easy way to capture the current cursor position. found a
> > > reference to 'ESC [ 6 n', but not sure how that works. I tried
> > > # echo -e '\e[6n'
> > > but that does not do what I expect.
> >
> > It makes terminal talk:
> >
> > shadow:~# echo -ne '\e[6n'; hexdump -vC
> > ^[[6;1R (here I press ^D^D to let hexdump see EOF) 00000000 1b 5b 36 3b 31
> > 52 |.[6;1R|
> > 00000006
> >
>
> Denys, I have no idea what the heck that means! :)
>
> I was actually looking for something to put in a script, kinda like:
>
> cp=$(get_cursor_position)
> [[ ${cp} -gt 0 ]] && echo
Yeah, I don't know an existing tool to accomplish that.
> so my logger would not be writing at the end of an unrelated line.
The proper fix is to fix programs to not print partial lines.
One event = one line, not half of a line!
Especially moronic example of this breakage is service
tools which work like this:
# service foo start
Starting foo: [ OK ]
where OK is even colored (green), as if we are imbeciles and
can't figure out what OK means.
It breaks horribly every time foo decides to say something
between "Starting foo:" and "OK" things. Which is not that uncommon -
programs tend to spew error messages when they have problems.
Who invented this "pretty looking" idiocy, I wonder...
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox