using 'printf' in a script in terminal window

Mike McNally emmecinque at gmail.com
Sun Nov 22 17:21:56 CET 2009


Clearing the screen and setting the cursor position are separate
operations (on the VT-102
at least).  The older VT-52 (and other terminals) had a "Home" escape
sequence, but that
site and my very vague memory suggests the VT-102 didn't.  Thus you'd
need something
like

  printf '\033[2J\033[0;0H'

I remember feeling at the time how frustrating it was that VT-xxx
escape codes were so
long, because of the response delays that meant when operating at 1200 baud :-)

The ESC c sequence does seem to clear the screen and home the cursor, though on
a real terminal that might not be what you'd want because it'd get rid
of other settings
you might want to keep.

On Sun, Nov 22, 2009 at 5:50 AM, Yves-Alexis Perez <corsac at debian.org> wrote:
> On dim., 2009-11-22 at 06:25 -0500, Jerry wrote:
>> Interesting! That occurs here also. However, I did notice that the
>> cursor is not relocated to the top of the screen. It remains at the
>> position it was when the printf '\033[2J' command was issued. Somehow,
>> that does not seem correct either.
>
> Maybe try:
>
> Reset to initial state
>  Esc  c
>  033 143
>
> Cheers,
> --
> Yves-Alexis
>
> _______________________________________________
> Xfce mailing list
> Xfce at xfce.org
> http://foo-projects.org/mailman/listinfo/xfce
> http://www.xfce.org
>



-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.



More information about the Xfce mailing list