Xterm - Turning off the cursor highlighting
I'm playing with "spinner" script for a wait cursor for my shell scripts; when it runs, the cursor area is highlighted (ie, it's reverse video on my xterm). I'd like to turn off the highlighting so that the spinner shows in "normal" video.
The script currently does this:
state=0
while [ 1 ]
do
case \$state in
0) echo "|\b\c"
state=1;;
1) echo "/\b\c"
state=2;;
2) echo "-\b\c"
state=3;;
3) echo "\\\" "\b\b\c"
state=0;;
esac
usleep 0.3
done
usleep is the gnu shellutils sleep which accepts fractions of a second.
A look through various man pages (tput, stty, terminfo, etc) and the shell FAQ didn't turn up anything (or at least anything that worked :-).
I did try these three variations on the echo command with no success:
echo `tput chts` "..."
echo `tput civis` "..."
echo "<ESC>[0m....."
Any suggestions are appreciated!
Dan
Re: Xterm - Turning off the cursor highlighting
Daniel Rawson, le Wed 08 Mar 2006 13:31:46 -0500, a écrit :[color=blue]
> I did try these three variations on the echo command with no success:
>
> echo `tput chts` "..."
> echo `tput civis` "..."
> echo "<ESC>[0m....."[/color]
Just call
tput civis
It should be sufficient.
Re: Xterm - Turning off the cursor highlighting
Samuel Thibault wrote:[color=blue]
> Daniel Rawson, le Wed 08 Mar 2006 13:31:46 -0500, a écrit :
>[color=green]
>>I did try these three variations on the echo command with no success:
>>
>>echo `tput chts` "..."
>>echo `tput civis` "..."
>>echo "<ESC>[0m....."[/color]
>
>
> Just call
>
> tput civis
>
> It should be sufficient.[/color]
Doesn't seem to do it . . . . I tried unsetting PS1 to see if that would help, but no dice.
:-((
Thanks!
Dan
Re: Xterm - Turning off the cursor highlighting
Daniel Rawson <daniel_dot_rawson@take_this_out!asml.com> writes:
[color=blue]
> Samuel Thibault wrote:[color=green]
>> Daniel Rawson, le Wed 08 Mar 2006 13:31:46 -0500, a écrit :
>>[color=darkred]
>>>I did try these three variations on the echo command with no success:
>>>
>>>echo `tput chts` "..."
>>>echo `tput civis` "..."
>>>echo "<ESC>[0m....."[/color]
>> Just call
>> tput civis
>> It should be sufficient.[/color]
>
> Doesn't seem to do it . . . . I tried unsetting PS1 to see if that
> would help, but no dice. :-(([/color]
Works for me.
I tried with rxvt and the xterm from Xorg 6.8.2.
In both cases the keyboard cursor vanished.
Take a look at what $TERM is set to.
Re: Xterm - Turning off the cursor highlighting
Dan Espen wrote:[color=blue]
> Daniel Rawson <daniel_dot_rawson@take_this_out!asml.com> writes:
>
>[color=green]
>>Samuel Thibault wrote:
>>[color=darkred]
>>>Daniel Rawson, le Wed 08 Mar 2006 13:31:46 -0500, a écrit :
>>>
>>>
>>>>I did try these three variations on the echo command with no success:
>>>>
>>>>echo `tput chts` "..."
>>>>echo `tput civis` "..."
>>>>echo "<ESC>[0m....."
>>>
>>>Just call
>>>tput civis
>>>It should be sufficient.[/color]
>>
>>Doesn't seem to do it . . . . I tried unsetting PS1 to see if that
>>would help, but no dice. :-(([/color]
>
>
> Works for me.
>
> I tried with rxvt and the xterm from Xorg 6.8.2.
> In both cases the keyboard cursor vanished.
>
> Take a look at what $TERM is set to.[/color]
Hmm . . . TERM=xterm
Two possibilities:
1. Something peculiar to Solaris 8 and 10 xterm
2. (most likely): I didn't understand how to use tput :-)
When I was testing, I modified my script to do:
tput civis
echo ...
echo ...
echo ...
etc.
I'll try re-building xterm from a recent Xorg release and see if that fixes it.
Dan
Re: Xterm - Turning off the cursor highlighting
Daniel Rawson <daniel_dot_rawson@take_this_out!asml.com> writes:
[color=blue]
> Dan Espen wrote:[color=green]
>> Daniel Rawson <daniel_dot_rawson@take_this_out!asml.com> writes:
>>[color=darkred]
>>>Samuel Thibault wrote:
>>>
>>>>Daniel Rawson, le Wed 08 Mar 2006 13:31:46 -0500, a écrit :
>>>>
>>>>
>>>>>I did try these three variations on the echo command with no success:
>>>>>
>>>>>echo `tput chts` "..."
>>>>>echo `tput civis` "..."
>>>>>echo "<ESC>[0m....."
>>>>
>>>>Just call
>>>>tput civis
>>>>It should be sufficient.
>>>
>>>Doesn't seem to do it . . . . I tried unsetting PS1 to see if that
>>>would help, but no dice. :-(([/color]
>> Works for me.
>> I tried with rxvt and the xterm from Xorg 6.8.2.
>> In both cases the keyboard cursor vanished.
>> Take a look at what $TERM is set to.[/color]
> Hmm . . . TERM=xterm
>
> Two possibilities:
> 1. Something peculiar to Solaris 8 and 10 xterm
> 2. (most likely): I didn't understand how to use tput :-)
>
> When I was testing, I modified my script to do:
>
> tput civis
> echo ...
> echo ...
> echo ...
>
> etc.
>
> I'll try re-building xterm from a recent Xorg release and see if that fixes it.[/color]
I just tried myself using Solaris 8 xterm.
Doesn't work for me either.
I then captured the civis output from a Linux machine
and tried using it on the Solaris xterm, still no good.
I think rebuilding a current xterm will probably do it.
Re: Xterm - Turning off the cursor highlighting
Dan Espen <daneNO@more.mk.spamtelcordia.com> wrote:[color=blue][color=green]
>> I'll try re-building xterm from a recent Xorg release and see if that fixes it.[/color][/color]
[color=blue]
> I just tried myself using Solaris 8 xterm.
> Doesn't work for me either.
> I then captured the civis output from a Linux machine
> and tried using it on the Solaris xterm, still no good.[/color]
[color=blue]
> I think rebuilding a current xterm will probably do it.[/color]
"current" xterm is supposedly available for Solaris (though I don't keep
track of that). The escape happens to be the same as Linux console
since it's derived from vt320 (ten years ago - according to my changelog
- Linux changelogs tend to be as scarce as usable release notes for
Solaris).
xterm supports ANSI color, VT220 emulation and UTF-8
There's an faq at
[url]http://invisible-island.net/xterm/xterm.faq.html[/url]
[url]ftp://invisible-island.net/xterm/[/url]
--
Thomas E. Dickey
[url]http://invisible-island.net[/url]
[url]ftp://invisible-island.net[/url]
Re: Xterm - Turning off the cursor highlighting
Thomas Dickey wrote:[color=blue]
> Dan Espen <daneNO@more.mk.spamtelcordia.com> wrote:
>[color=green][color=darkred]
>>>I'll try re-building xterm from a recent Xorg release and see if that fixes it.[/color][/color]
>
>[color=green]
>>I just tried myself using Solaris 8 xterm.
>>Doesn't work for me either.
>>I then captured the civis output from a Linux machine
>>and tried using it on the Solaris xterm, still no good.[/color]
>
>[color=green]
>>I think rebuilding a current xterm will probably do it.[/color]
>
>
> "current" xterm is supposedly available for Solaris (though I don't keep
> track of that). The escape happens to be the same as Linux console
> since it's derived from vt320 (ten years ago - according to my changelog
> - Linux changelogs tend to be as scarce as usable release notes for
> Solaris).
>
> xterm supports ANSI color, VT220 emulation and UTF-8
> There's an faq at
> [url]http://invisible-island.net/xterm/xterm.faq.html[/url]
> [url]ftp://invisible-island.net/xterm/[/url]
>[/color]
I just (finally) had a chance to try this; rebuilding ONLY the xterm binary did NOT fix this; obviously it's still loading code from /usr/lib/libX* . . . . :-( and the curses code from /usr/lib/libcurses.*
Dan
Re: Xterm - Turning off the cursor highlighting
Daniel Rawson <daniel_dot_rawson@take_this_out!asml.com> writes:
[color=blue]
> Thomas Dickey wrote:[color=green]
>> Dan Espen <daneNO@more.mk.spamtelcordia.com> wrote:
>>[color=darkred]
>>>>I'll try re-building xterm from a recent Xorg release and see if that fixes it.[/color]
>>[color=darkred]
>>>I just tried myself using Solaris 8 xterm.
>>>Doesn't work for me either.
>>>I then captured the civis output from a Linux machine
>>>and tried using it on the Solaris xterm, still no good.[/color]
>>[color=darkred]
>>>I think rebuilding a current xterm will probably do it.[/color]
>> "current" xterm is supposedly available for Solaris (though I don't
>> keep
>> track of that). The escape happens to be the same as Linux console
>> since it's derived from vt320 (ten years ago - according to my changelog
>> - Linux changelogs tend to be as scarce as usable release notes for
>> Solaris).
>> xterm supports ANSI color, VT220 emulation and UTF-8
>> There's an faq at
>> [url]http://invisible-island.net/xterm/xterm.faq.html[/url]
>> [url]ftp://invisible-island.net/xterm/[/url]
>>[/color]
> I just (finally) had a chance to try this; rebuilding ONLY the xterm binary did NOT fix this; obviously it's still loading code from /usr/lib/libX* . . . . :-( and the curses code from /usr/lib/libcurses.*[/color]
Don't forget that the 'tput civis' on Solaris is borked too.
Are you sending the right escape sequence?
Re: Xterm - Turning off the cursor highlighting
Dan Espen <daneNO@more.mk.spamtelcordia.com> wrote:[color=blue][color=green]
>> I just (finally) had a chance to try this; rebuilding ONLY the xterm binary did NOT fix this; obviously it's still loading code from /usr/lib/libX* . . . . :-( and the curses code from /usr/lib/libcurses.*[/color][/color]
[color=blue]
> Don't forget that the 'tput civis' on Solaris is borked too.
> Are you sending the right escape sequence?[/color]
It's probably lacking that capability and therefore sending an empty string.
infocmp shows the data that tput uses.
--
Thomas E. Dickey
[url]http://invisible-island.net[/url]
[url]ftp://invisible-island.net[/url]
Re: Xterm - Turning off the cursor highlighting
Thomas Dickey <dickey@saltmine.radix.net> writes:
[color=blue]
> Dan Espen <daneNO@more.mk.spamtelcordia.com> wrote:[color=green][color=darkred]
>>> I just (finally) had a chance to try this; rebuilding ONLY the xterm binary did NOT fix this; obviously it's still loading code from /usr/lib/libX* . . . . :-( and the curses code from /usr/lib/libcurses.*[/color][/color]
>[color=green]
>> Don't forget that the 'tput civis' on Solaris is borked too.
>> Are you sending the right escape sequence?[/color]
>
> It's probably lacking that capability and therefore sending an empty string.
> infocmp shows the data that tput uses.[/color]
Yep, MIA.
(I checked Sol 10 too.)