clear
stty sane
tput clear
tput reset
tput cup 0 0
# echo ^v^o (CTRL-v & CTRL-o)
I...@am.me wrote:
> "Allen M. Cohen" wrote:
>> Sometimes an xterm seesion gets stuck in either reverse video state
>> and/or underline state.
Probably "binary" output (or a wrong TERM or alike),
you should find it's source.
> # echo ^v^o (CTRL-v & CTRL-o)
This *only* helps if there was a ^N before - and still fails semetimes
depending on both shell *and* stty settings.
$ cat
^V^O
^D
is what you might prefer, trying ^J instead of return, in case.
There are several much more general ways to solve such a mess.
Find out about the cause, your TERM setting, it's termcap/terminfo entry
and the way your tools (reset, tput reset, etc) use:
<http://www.uni-ulm.de/~s_smasch/alternate_charset/>
Sven
<control><button-2> -> Do Full Reset
Sometimes you have to do it twice to get the reverse video correct.
--
Darren Dunham ddu...@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< How are you gentlemen!! Take off every '.SIG'!! >
I use these ksh functions:
function ulon {
print -n '\033[4m'
}
function uloff {
print -n '\033[24m'
}
function blinkon {
print -n '\033[5m'
}
function blinkoff {
print -n '\033[25m'
}
function boldon {
print -n '\033[1m'
}
function boldoff {
print -n '\033[22m'
}
function colorreset {
print -n '\033[m'
}
I find the colorreset function is sufficient.
> Sometimes an xterm seesion gets stuck in either reverse video state
> and/or underline state. I've tried lots of things to reset it, but none
> work. Help...
How about calling up the VT Options menu using CTRL-middle_mouse_button,
and then selecting either "Do Soft Reset" or "Do Full Reset"?
Or, /usr/ucb/reset usually works for me.
---
/^^^\ Craig Dupree Center for Space Research
/~O~O~\ UNIX Support University of Texas
\ U / dup...@csr.utexas.edu 3925 W. Braker Lane, #200
-oOo-------oOo- MCC, 2.9208 Austin, TX 78759
(512)471-7248
kludge, n.: An ill-assorted collection of poorly-matched parts, forming a
distressing whole. --Jackson Granholm, "Datamation"
Thereafter, Sven Mascheck <sven.mascheck(at)student.uni-ulm.de>
suggested that a character-set problem was in effect. However, I think
Allen is *not* reporting a line-drawing character problem. He seems to
be having a failure to reset video attributes.
Darren Dunham <ddunham(at)taos.com> more helpfully suggested
|
| <control><button-2> -> Do Full Reset
(This uses what is usually the middle mouse button in X to bring up the
"VT Options" menu of the "xterm" application, so that you can select the
"Do Full Reset" command.)
The situation is complicated by the fact that variants of "xterm" in
different Unix distributions may have differing behavior with respect to
background color handling and attribute setting.
I devised a C-shell hack that sends some appropriate control sequences to
an DEC-VT100/VT220-compatible terminal or emulator that should bring it to
a known good state. A uuencoded self-explanatory file "cls.uue" appears
below. Users of other shells should have no trouble adapting the technique.
(There is a small modification possible to reverse the default dark/light
fore-/background setting.)
Related resources may be found at:
http://www.cs.utk.edu/~shuford/terminal_index.html
...Richard S. Shuford
---<snip>-----<snip>-----<snip>-----<snip>-----<snip>-----<snip>-----<snip>---
# -----------------------------------------------------------------------
# A C shell hack to clear a VT100-type screen from abnormal modes.
# (R. Shuford 20010406)
# In your home directory, execute
#
# % uudecode cls.uue
#
# and install the following alias in your .cshrc
#
# alias cls "cat ~/.cls"
#
# (the alias will show up the next time your csh initializes)
#
# What it does: turn off both autoprint and print-controller modes (MC)
# turn off Tektronix mode and ReGIS mode (ST)
# set the G0 character set to ASCII
# set the G1 character set to DEC Special Graphics
# invoke G0 into GL
# force "dark background" (DECSCNM) (xterm does the opposite?)
# turn off SGR visual character attributes
# set scrolling region boundaries to top and bottom (DECSTBM)
# home the cursor
# clear the screen
#
# ------------------------------------------------------------------------
# Here is an alternate version that does the above operations and also
# forces the screen mode to "light background" (DECSCNM: Esc [ ? 5 l)
#
begin 444 .cls
J&ULT:1M;/S1I&UL_,SAL&UP;*$(;*3 /&UL_-6@;6S!M&UMR&UM(&UM*
end
#
#
# ------------------------------------------------------------------------
# I had in mind also to use DECSASD Esc [ 0 $ }
# to force use of the main display (instead of a VT330's status line),
# but it puts Openwindows shelltools into an unusable scroll mode.
# Of course, if you don't mind losing some transient parameters, you can
# use the "soft" reset DECSTR Esc [ ! p
# or the ANSI "hard" reset RIS Esc c
# ------------------------------------------------------------------------
---<snip>-----<snip>-----<snip>-----<snip>-----<snip>-----<snip>-----<snip>---
>> Sometimes an xterm session gets stuck in either reverse video state
>> and/or underline state.
> However, I think Allen is *not* reporting a line-drawing character problem.
Yup, thanks for pointing out, i confused underline with linedrawing!
My reference tried to cover this and all related stuff (xterm reset, using
an alias to reset a VT like terminal, reason for linedrawing problems,
as text really becomes unreadable, then) in detail with explanations.
> I devised a C-shell hack that sends some appropriate control sequences to
> an DEC-VT100/VT220-compatible terminal or emulator that should bring it to
> a known good state. A uuencoded self-explanatory file "cls.uue" appears
> below.
Nice idea to use uuencoding to transfer the control sequences via Usenet.
An alternative i had found in an old Usenet posting ('95) is something
like the follwing (here bourne shell):
alias vtn='echo "X[mX(BX)0OX[?5lX7X[rX8" | tr "XO" "\033\017"'
This is even editable on the run when experimenting.
BTW, about your control sequences: In XFree86/X11 xterm with
TERM=xterm-xfree86/vt100, the last few characters are "left over"
("8J i<esc>"). Perhaps as there is a "nobreakspace" contained.
When skipping this last control sequence for now, your version would read
alias vtn='echo "X[4iX[?4iX[?38lX\X(BX)0OX[?5lX[0mX[rX[HX[JY[4iX[?4iX
[?38lX\X(BX)0OX[?5lX[0mX[rX[H" | tr "XOY" "\033\017\203"'
(line broken at end)
[I am not sure about the FUP2, comp.terminals?]
Sven
In comp.unix.solaris, Richard S. Shuford wrote:
> Allen M. Cohen wrote:
>> Sometimes an xterm session gets stuck in either reverse video state
>> and/or underline state.
> However, I think Allen is *not* reporting a line-drawing character problem.
Yup, thanks for pointing out, i confused underline with linedrawing!
My reference [1]tried to cover this and all related stuff (xterm reset,
using an alias to reset a VT like terminal, reason for linedrawing problems,
as text really becomes unreadable, then) in detail with explanations.
> I devised a C-shell hack that sends some appropriate control sequences to
> an DEC-VT100/VT220-compatible terminal or emulator that should bring it to
> a known good state. A uuencoded self-explanatory file "cls.uue" appears
> below.
Nice idea to use uuencoding to transfer the control sequences via Usenet.
An alternative i had found in an old Usenet posting ('95) is something
like the follwing (here bourne shell):
alias vtn='echo "X[mX(BX)0OX[?5lX7X[rX8" | tr "XO" "\033\017"'
This is even editable on the run when experimenting.
BTW, about your control sequences: In XFree86/X11 xterm with
TERM=xterm-xfree86/vt100, the last few characters are "left over"
("8J i<esc>"). Perhaps as there is a "nobreakspace" contained.
When skipping this last control sequence for now, your version would read
alias vtn='echo "X[4iX[?4iX[?38lX\X(BX)0OX[?5lX[0mX[rX[HX[JY[4iX[?4i
X[?38lX\X(BX)0OX[?5lX[0mX[rX[H" | tr "XOY" "\033\017\203"'
(line broken at end)
[I am not sure about the FUP2, comp.terminals?]
Sven
--
[1] <http://www.uni-ulm.de/~s_smasch/alternate_charset/>, tuned for critics
echo "\033c"
Posted and Emailed.
Try this:
tput rmso
This is puzzling. The sequence "8J i" does not appear in my file.
Here again is the uuencoded form:
-----------------------------------------------------------
begin 444 .cls
J&ULT:1M;/S1I&UL_,SAL&UP;*$(;*3 /&UL_-6P;6S!M&UMR&UM(&UM*
end
-----------------------------------------------------------
When decoded and after the unprintables are rendered into printable
tokens, it looks like this:
^[[4i^[[?4i^[[?38l^[\^[(B^[)0^O^[[?5l^[[0m^[[r^[[H^[[J
There is nothing in there that should be interpreted as a "nobreakspace",
if the ANSI X3.64 parsing rules are being properly followed.
Is it possible that your "uudecode" program is decoding improperly?
The XFree86/X11 distribution contains the "xterm" variant maintained
by Thomas Dickey, and I certainly have tested my little hack with an
earlier version of that package.
I note that several people have contributed suggestions on how to
reset xterm visual attributes using the "tput" command to extract
codes from the "terminfo" database. This is arguably the "proper"
way to do the job, but my cat-the-file hack does work even if the
terminal type is set wrong, and it also resets some obscure modes
of DEC-style terminals that may not be represented by codes in the
terminfo database. (There are yet some people in the world who are
using real VT420 character-cell terminals to connect to Solaris!)
Other video-terminal information is archived at
http://www.cs.utk.edu/~shuford/terminal_index.html
...Richard S. Shuford
shuford(at)list.stratagy.com
> The sequence "8J i" does not appear in my file.
> Is it possible that your "uudecode" program is decoding improperly?
It was actually broken, decoding the sequence properly and then
appending more (similar) escape sequences. Some were just
repeated, some where invalid, but actually still escape sequences
with the usual length.
This sharutils-4.2 version was generally working fine,
but has apparently a problem with short files.
Sorry for bugging you! (i should have become suspicious, anyway)
> When decoded and after the unprintables are rendered into printable
> tokens, it looks like this:
> ^[[4i^[[?4i^[[?38l^[\^[(B^[)0^O^[[?5l^[[0m^[[r^[[H^[[J
could also be
$ echo "X[4iX[?4iX[?38lX\X(BX)0OX[?5lX[0mX[rX[HX[J" | tr "XO" "\033\017"
Sven
--
[fup2 poster]
>> Sometimes an xterm seesion gets stuck in either reverse video state
>> and/or underline state. I've tried lots of things to reset it, but none
>> work. Help...
>> Here's what I tried:
>>
>> clear
>> stty sane
>> tput clear
>> tput reset
>> tput cup 0 0
> I use these ksh functions:
which are probably related to his problem (SGR 22, 24 and 25 aren't
implemented in Solaris' xterm)
> function ulon {
> print -n '\033[4m'
> }
> function uloff {
> print -n '\033[24m'
> }
> function blinkon {
> print -n '\033[5m'
> }
> function blinkoff {
> print -n '\033[25m'
> }
> function boldon {
> print -n '\033[1m'
> }
> function boldoff {
> print -n '\033[22m'
> }
> function colorreset {
> print -n '\033[m'
> }
> I find the colorreset function is sufficient.
--
Thomas E. Dickey <dic...@radix.net> <dic...@herndon4.his.com>
http://dickey.his.com
ftp://dickey.his.com