Operating System - HP-UX
1758620 Members
1931 Online
108874 Solutions
New Discussion юеВ

vi editor : cant view file properly in vi

 
SOLVED
Go to solution
Satya Thotapalli
Occasional Advisor

vi editor : cant view file properly in vi

Hello,
When I open a file in vi, I see only the first line. That too with lot of extra characters.
I expected to see all the contents of the file but I cant.
contents of file -
$ cat tarlist
api
appserv
bin
cblbin
install
output
prcs
psconfig.sh
script
sql
sqr
src

Below is what I see when I do a vi of the same file. the telnet client used is -reflection. terminal type is VT500-7
ver - HP UX B.11.00

$ vi tarlist
~0y0C23y0C"tarlist" 12 lines, 74 characters0y0Ci1y0Cappserv

Pls help.

Regards,
Satya
10 REPLIES 10
Steven E. Protter
Exalted Contributor

Re: vi editor : cant view file properly in vi

Shalom,

Your TERM variable is wrong.

I suggest vt100 or vt220

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Satya Thotapalli
Occasional Advisor

Re: vi editor : cant view file properly in vi

Hello SEP,
I tried the closest match vt102 with out success.
Satya
melvyn burnard
Honored Contributor
Solution

Re: vi editor : cant view file properly in vi

try this before issuing the vi command:
eval `ttytype -s`
tset

see if that sets the terminal corectly
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Kapil Jha
Honored Contributor

Re: vi editor : cant view file properly in vi

Please check if this problem is with only one user or with every user.
I would suggest
#export EDITOR=vt100
#stty sane
#vi <>

Hope this help.
BR,
Kapil
I am in this small bowl, I wane see the real world......
Satya Thotapalli
Occasional Advisor

Re: vi editor : cant view file properly in vi

Hello Melvyn,
Your solution did work thanks! but I have to do this every time I login. Do you hv a permanent fix ?
Regards,
Satya
Kapil Jha
Honored Contributor

Re: vi editor : cant view file properly in vi

Check youe .profile file it would be having some issue.
to avoid doing everytime add those two lines in ur .profile file.
I would wonder to know if the command I sent worked or not.
BR,
Kapil
I am in this small bowl, I wane see the real world......
Satya Thotapalli
Occasional Advisor

Re: vi editor : cant view file properly in vi

Kapil,
I'm sorry your commands did not solve my problem. Pls can you detail what I need to check in the .profile ? Any specific setting ?
Satya
Kapil Jha
Honored Contributor

Re: vi editor : cant view file properly in vi

:(

anyways just add those 2 line

eval 'ttytype -s'
tser

at the end of your .profile file of user.
.profile would be in home directory of user.
so that thoese command would always run when user logs in.
BR,
Kapil
I am in this small bowl, I wane see the real world......
melvyn burnard
Honored Contributor

Re: vi editor : cant view file properly in vi

edit your .profile file, and add the lines into the .profile, and this will run every time you log in
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!