--
* John Oliver http://www.john-oliver.net/ *
Hmm, sounds weird. Is this Solaris' /bin/vi or are you using vim? I'd
try to set the TERM environment variable to a different value. 'vt102'
or 'xterm' or maybe 'xtermc' should work.
I.e. in sh/ksh/bash
TERM=xtermc
export TERM
or in csh/tcsh
setenv TERM xtermc
HTH,
Thomas
FWIW, I just attempted to duplicate the OP's problem using PuTTY
from a Windows box and was unsuccesful. PuTTY'd to a Solaris 10:
-bash-3.00$ echo $TERM
xterm
You might want to check your PuTTY configuration -- there are
many options. When I ssh'd from a Cygwin window on the same
Windows box to the same Solaris 10 box, TERM=cygwin
vi's either confused about the screensize (if the LINES environment variable
is set), or about how to scroll text (if TERM is set incorrectly). For
instance, "sun" wouldn't work. xtermc is a poor choice for other reasons.
If your system has ncurses' terminfo installed, then setting TERM to "putty"
would work reasonably well.
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
-bash-3.00$ echo $LINES
60
-bash-3.00$ echo $TERM
xterm
-bash-3.00$ export TERM=putty
-bash-3.00$ echo $TERM
putty
-bash-3.00$ /usr/local/bin/sudo vi /etc/ssh/sshd_config
Password:
putty: Unknown terminal type
I don't know what kind of terminal you are on - all I have is 'putty'.
[Using open mode]
"/etc/ssh/sshd_config" 160 lines, 5252 characters
I get the same behavior on every Sun box here, and my PuTTY works
perfectly on every Linux box here. My Solaris installs are very
plain-Jane... other than being done via Jumpstart, there is nothing
special, no weird packages being installed or modified...
-bash-3.00$ cat /jumpstart/config/sun4v_profile
install_type initial_install
cluster SUNWCreq
cluster SUNWCssh add
cluster SUNWCxorgserver add
partitioning explicit
filesys rootdisk.s0 10000 /
filesys rootdisk.s1 1000 swap
filesys rootdisk.s4 4000 /usr
filesys rootdisk.s5 4000 /var
filesys rootdisk.s6 30000 /opt
filesys rootdisk.s7 free /export/home
system_type standalone
package SUNWxorg-clientlibs add
package SUNWxwfnt add
package SUNWxwplr add
package SUNWxwice add
package SUNWxwplt add
package SUNWxwrtl add
package SUNWeurf add
package SUNWi15rf add
package SUNWxwman add
package SUNWdoc add
package SUNWman add
package SUNWbash add
package SUNWgzip add
package SUNWless add
package SUNWgnome-base-libs-root add
package SUNWctpls add
package SUNWxi18n add
package SUNWuiu8 add
package SUNWmfrun add
package SUNWbtool add
package SUNWadmfr add
package SUNWadmfw add
package SUNWsprot add
package SUNWtoo add
package SUNWscpr add
package SUNWscpu add
package SUNWntpr add
package SUNWntpu add
You haven't revealed the system upon which you're running the
putty client to ssh to your Solaris 10 box though you did write
you have Linux and Solaris systems.
Why not keep things simple and use ssh directly? To wit:
$ ssh username@remoteIP
I use PuTTY only on Windows boxes that don't also have, say,
Cygwin installed (which would have ssh).
BTW, "stty -a" reveals the info the system knows about your
present "terminal".
FWIW, PuTTY on a Windows box to a Solaris 10 box:
[login]
$ echo $TERM
xterm
ssh under Cygwin on a Windows box to a Solaris 10 box:
$ ssh username@solarisIP
[login]
$ echo $TERM
xterm
ssh on a Solaris 10 box back to itself:
$ ssh username@localhost
[login]
$ echo $TERM
xterm
ssh on a Linux box to a Solaris 10 box:
$ ssh username@solarisIP
[login]
$ echo $TERM
xterm
Sorry, I didn't think that was relevant, and fairly obvious... Windows
:-) XP Professional, probably SP3.
> Why not keep things simple and use ssh directly? To wit:
>
> $ ssh username@remoteIP
>
> I use PuTTY only on Windows boxes that don't also have, say,
> Cygwin installed (which would have ssh).
I do have Cygwin (I use and love the X server! :-) ). I'm just so used
to using PuTTY... I've been using it for so long I can't even remember
when I started :-)
I suppose I could just start to use the Cygwin command line, but that
doesn't actually resolve the issue... I might run into some other weird
issue, and what then? Start using yet another client? I'm hoping that
someone else who uses PuTTY to talk to Solaris knows about the little
switch that needs to be flipped or whatever and I can learn something
other than, "Just use another terminal emulator".
> BTW, "stty -a" reveals the info the system knows about your
> present "terminal".
Last login: Mon Sep 15 15:52:26 2008 from joliver-380-xp.
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
-bash-3.00$ stty -a
speed 38400 baud;
rows = 60; columns = 80; ypixels = 0; xpixels = 0;
csdata ?
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^?; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts
-crtsxoff -parext
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3
My PuTTY windows is 80 characters wide and 60 lines "deep". As for the
rest of it, I'd probably have better luck with Attic Greek... :-)
> I suppose I could just start to use the Cygwin command line, but that
> doesn't actually resolve the issue... I might run into some other weird
> issue, and what then? Start using yet another client? I'm hoping that
> someone else who uses PuTTY to talk to Solaris knows about the little
> switch that needs to be flipped or whatever and I can learn something
> other than, "Just use another terminal emulator".
Whether you use Cygwin ssh or PuTTY, place the following line in your
~/.bashrc on each Solaris system:
TERM=xterm; export TERM
OK, too much unnecessary complication is being added. This likely isn't
a difficult problem.
Step #1: Don't use TERM=cygwin, TERM=putty, or anything else odd like
that. These are not standard terminal types on a stock system, and won't
be there unless you've added them.
Step #2: Find out what kind of terminal putty is presenting to the server.
It's under Connection-->Data. Make sure it's a good "standard"
type (i.e. vt102, vt220, xterm, etc., potentially any termtype
that resides in /usr/share/lib/terminfo/*)
Step #3: When you log in, echo $TERM. If it doesn't match what you found
in step #2, set it, and then change your login scripts to capture
it.
Most like problem is that putty is presenting a strange term type in
step #2, or (most likely of all) none at all.
Colin
My terminal *is* xterm.
And I don't... TERM=xterm
> Step #2: Find out what kind of terminal putty is presenting to the server.
> It's under Connection-->Data. Make sure it's a good "standard"
> type (i.e. vt102, vt220, xterm, etc., potentially any termtype
> that resides in /usr/share/lib/terminfo/*)
My default is "xterm".
> Step #3: When you log in, echo $TERM. If it doesn't match what you found
> in step #2, set it, and then change your login scripts to capture
> it.
It does.
> Most like problem is that putty is presenting a strange term type in
> step #2, or (most likely of all) none at all.
It isn't :-)
FWIW, I tried setting vt100 in PuTTY, and that seemed to work. I hate
workarounds instead of solutions, but if that's the only answer I'm
going to get, I'll take it.
Thanks, all.
>TERM=xterm; export TERM
One of the problems here is that Sun's xterm terminfo definition
is incorrect. It specifies a terminal of 65 lines by 80 columns,
with no colour. Here, we always replace it with one that specifies
24 lines by 80 columns with colour, so that Sun's versions of xterm
and gnome-terminal work correctly. I've been unsuccessful in getting
Sun to change their definition.
--
-Gary Mills- -Unix Support- -U of M Academic Computing and Networking-
I don't have Windows on bare metal but it is in a VBox. I installed PuTTY
and used it to connect to some remote hosts - Solaris Express, Debian
Linux, Ubuntu Linux and OpenBSD - and in all cases the TERM was set by
PuTTY to be xterm. In none of those sessions could I duplicate the OP's
problem.
I alias ls to 'gnuls --color=auto' and all xterms in PuTTY correctly
display the various colors for directories, files and executables -
including SXCE_b96.
The -only- utility in which the remote TERM=xterm has color problems is
mutt. If I want a colorized mutt then export TERM=xterm-color.
John,
have you tried xtermc (i.e. color xterm), as I said before?
That works great for me with putty and Solaris 10...
YMMV
You might want to check which curses/ncurses your vim is linked against.
I'm using CSWvim which is linked against CSWncurses.
- Thomas
Ah, another data point. Good! :-)
Right-clicking "My Computer" and selecting "Properties" reveals
the WinXP information (or download from <http://www.belarc.com/>
if you want to know everything about your system including the
product CD keys when you reinstall after a hard disk failure).
I just powered-up my WinXP SP3 laptop and, as I wrote before, it
PuTTYs to Solaris 10 and works fine as an xterm.
The version of PuTTY I'm running is "PuTTY Release 0.60" (click
the [About] when PuTTY is started).
My guess is it's your PuTTY configuration causing your problem;
there are 25 separate and distinct configuration windows per the
following list (noting that *everything* in this list can be
clicked on for a config window):
Session [Logging]
Terminal [Keyboard, Bell, Features]
Window [Appearance, Behaviour, Translation, Selection, Colours]
Connection [Data, Proxy, Telnet, Rlogin]
[SSH [Kex, Auth, TTY, X11, Tunnels, Bugs]]
[Serial]
Hmmm, "Kex" in that menu list is a PuTTY typo; it brings up a key
exchange configuration window.
And when I wrote everything (above) can be clicked on, that includes
"Session", "Terminal", "Window" and "Connection" which isn't obvious
to many who use PuTTY.
Without comparing two sets of 25 screen dumps I don't know what's
different between your config and mine, so click on all the items
and look for something "obvious".
Whoa, that just reminded me there are some other xterm def problems
since Solaris 2.5 (1995) that I had to fix on 2.5, 2.5.1, 2.6, 7 and
8 (I never installed 9) that I need to check on my Solaris 10 box.
What I did back then was put the corrected defs in a /usr/local/*
termlib (IIRC); now I need to powerup one of those old systems and
read its CHANGELOG. I'll post (or put on a website) my notes.
BTW, getting Sun to change a definition is like pulling teeth. :-)
10+ years ago there was a nasty bug in the shutdown script and I
posted my fixed version either here or in comp.sys.sun.admin and
received 100s of "Thank you!" emails. System shutdown seems to
work OK with Solaris 10u5, so Sun must've finally fixed it. :-)
You do know that PuTTY also runs on Linux/UNIX/MacOS? So it wasn't
obvious which variant you had. :-)
> [...]
> The version of PuTTY I'm running is "PuTTY Release 0.60" (click
> the [About] when PuTTY is started).
What version are you running? 0.60 is the latest and I just
noticed the PuTTY FAQ was updated Sept. 15, 2008. Nothing in it,
though, regarding Solaris, and the FAQ reiterates PuTTY defaults
to being an xterm client.
> [...]
> My guess is it's your PuTTY configuration causing your problem;
> there are 25 separate and distinct configuration windows per the
> [...]
Probably simplest to uninstall PuTTY and download/install anew
from their website:
<http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html>
>On Sep 16, 2:53 pm, Gary Mills <mi...@cc.umanitoba.ca> wrote:
>> [...]
>> One of the problems here is that Sun's xterm terminfo definition
>> is incorrect. It specifies a terminal of 65 lines by 80 columns,
>> with no colour. Here, we always replace it with one that specifies
>> 24 lines by 80 columns with colour, so that Sun's versions of xterm
>> and gnome-terminal work correctly. I've been unsuccessful in getting
>> Sun to change their definition.
>Whoa, that just reminded me there are some other xterm def problems
>since Solaris 2.5 (1995) that I had to fix on 2.5, 2.5.1, 2.6, 7 and
>8 (I never installed 9) that I need to check on my Solaris 10 box.
The size of the window in terminfo is not used, typically, because
the stty windows size is used. ("stty -a" will print it.)
The only time that the size is "wrong" when you connect over an
actual terminal, e.g., /dev/console. (tip in xterm to console)
Casper
The information in PuTTY's FAQ might be credible if PuTTY's developers
documented PuTTY's behavior. Since they don't, it's left as an exercise
for others. For example - see
ftp://invisible-island.net/ncurses/terminfo.src.gz
# PuTTY 0.55 (released 3 August 2004)
# http://www.chiark.greenend.org.uk/~sgtatham/putty/
#
# Comparing with 0.51, vttest is much better (only a few problems with the
# cursor position reports and wrapping).
#
# PuTTY 0.51 (released 14 December 2000)
#
# This emulates vt100 + vt52 (plus a few vt220 features: ech, SRM, DECTCEM, as
# well as SCO and Atari, color palettes from Linux console). Reading the code,
# it is intended to be VT102 plus selected features. By default, it sets $TERM
# to xterm, which is incorrect, since several features are misimplemented:
#
# Alt+key always sends ESC+key, so 'km' capability is removed.
#
# Control responses, wrapping and tabs are buggy, failing a couple of
# screens in vttest.
#
# xterm mouse support is not implemented (unrelease version may).
#
# Several features such as backspace/delete are optional; this entry documents
# the default behavior -TD
The terminfo size would only override if an application choose to do this.
That's a curses function (which vi probably doesn't call):
The use_env routine, if used, is called before initscr or
newterm are called. When called with FALSE as an argu-
ment, the values of lines and columns specified in the
terminfo database will be used, even if environment vari-
ables LINES and COLUMNS (used by default) are set, or if
curses is running in a window (in which case default
behavior would be to use the window size if LINES and
COLUMNS are not set).
Even on Solaris, "xterm" could be different lists of data (since it's
configurable). infocmp will show what is being used.
(I recall that gnome-terminal has/had similar issues with scrolling using
the xterm terminfo which I wrote, but don't recall if PuTTY had that
particular defect).
Good.
>> Step #2: Find out what kind of terminal putty is presenting to the server.
>> It's under Connection-->Data. Make sure it's a good "standard"
>> type (i.e. vt102, vt220, xterm, etc., potentially any termtype
>> that resides in /usr/share/lib/terminfo/*)
>
> My default is "xterm".
Interesting. (and good)
>> Step #3: When you log in, echo $TERM. If it doesn't match what you found
>> in step #2, set it, and then change your login scripts to capture
>> it.
>
> It does.
Great! We're done here then! :-)
>> Most like problem is that putty is presenting a strange term type in
>> step #2, or (most likely of all) none at all.
>
> It isn't :-)
>
> FWIW, I tried setting vt100 in PuTTY, and that seemed to work. I hate
> workarounds instead of solutions, but if that's the only answer I'm
> going to get, I'll take it.
>
> Thanks, all.
Seriously, it sounds to me like the xterm terminfo is messed up. How
could this happen? I don't know--might be a Sun bug. Very odd, though.
Incidentally, if you're going to use a VTxxx emulator, much better to
use vt102 than vt100, as it fixes the bugs in the vt100 model. (vt220
is better still, with more features.)
Colin
This was probably my problem... my PuTTY window is set to 60 lines, and
it could well be 5 lines "up" where the scrolling started.
Thanks!
Just an FYI: my PuTTY is set to 140 columns and 48 rows with 500
scrollback lines and works fine into Solaris10u5 as an xterm.
Either you're not using version 0.60 or something else is set
differently than PuTTY's defaults.
I have PuTTY on Win2K-SP4, WinXP-SP3 and WinVista-SP1, and it
operates identically from all those systems into Solaris. The
only settings I changed from PuTTY's defaults are columns/rows,
scrollback lines, and display colors.