strange vi behavior


Recommended Posts

When I telnet from XP to the unraid server, vi behaves erratically.  Initially the file does not display correctly, arrow keys produce control chars, a simple 'x' erases the whole screen.  As an example, my working go file looks like this after a 'vi go' from the command prompt.

 

[0;10;7mUsage: [[
installpkg /boot/packages/socat-1.7.0.0-i486-2bj.tgzk12.1.tgz
installpkg /boot/packages/unraid_notify-2.54-noarch-unRAID.tgz
rontab -l >/tmp/crontab
echo "0 2 * * * /boot/daily_backups.sh 1>/dev/null 2>&1" >>/tmp/crontab
cp /tmp/crontab /var/spool/cron/crontabs/root-
crontab /tmp/crontab

 

There are missing lines, missing letters and garbage at the top.  I tried changing terminal type to vt100, but that didn't work.  I have ensured there are not PC newlines.  Any suggestions on what is going on?

 

Best,

Aaron

Link to comment

So, I got sshd running and tried logging in with that.  When I try to vi via ssh, I get

 

  vi: cygwin: unknown terminal type

 

What a pain.  Can someone help me understand what up?

 

Thanks,

Aaron

After logging in, type:

TERM=ansi

export TERM

 

If that does not work, try TERM=xterm

 

Then try again

Link to comment

 

Thanks for the suggestions.  I found a solution (below), but I tried these to see if they would help.

 

The TERM was already set to ansi, so the first one didn't help.

Setting the TERM to xterm was even worse.

 

After I found out that vi was a link to nvi

 

  vi -> nvi*

 

I decided to try vim instead.  It works just dandy for TERM=ansi.

 

Strange that this isn't a common problem given my relatively vanilla configuration. 

 

Regards,

Aaron

Link to comment

 

So, this prompts a follow up question.  How to most users edit files like /boot/config/go remotely?

 

My unraid server is sitting in a closet, so it seems the options are

- copy file to location on shared disks, edit, copy it back

- sneaker net the usb to my desktop, edit, sneaker net back

- use vi

 

Am I missing some easier way?  I just get by in vi, so not love lost ;-)

 

Thx, A

Link to comment

 

So, this prompts a follow up question.  How to most users edit files like /boot/config/go remotely?

 

My unraid server is sitting in a closet, so it seems the options are

- copy file to location on shared disks, edit, copy it back

- sneaker net the usb to my desktop, edit, sneaker net back

- use vi

 

Am I missing some easier way?  I just get by in vi, so not love lost ;-)

 

Thx, A

The "go" script is processed to remove extra carriage returns before it is executed.  It is one of the files where you can use any editor.

 

So, on your windows PC, open file explorer, type

\\tower\flash\config

in the path, then open and edit "go" using anything you like. 

 

This is not true of many of the native linux configuration files, but it will work just fine for the "go" script.

 

 

Link to comment

A person who is man enough to use vi should not attempt doing it from a M$ Windows command prompt window unless he is brave enough to drop into ex editor :)

It was almost 5 years before a UNIX box I was on had ANY visual editor.  "ed" was all we had, and paper teleprinters were the I/O device...  Did not even have a CRT attached.   Did I mention the teleprinter was at a blazing 300 baud?  I wrote many programs on it under the Mashey shell.  It even had labels and "goto" in the shell... ahh the old days... (John Mashey's shell pre-dated the Borne shell, and the Korn shell)

 

I can do "ex" commands...  (Although I'll admit, it has been years since I had to drop into "ex"...  (Capital "Q"  ;D)

 

Joe l.

It takes an old-timer (like me) to remember that "ex" exists.  You must be OLD TOO!!!.

 

Link to comment

 

 

It takes an old-timer (like me) to remember that "ex" exists.  You must be OLD TOO!!!.

 

 

Suffice it to say I wrote my first program in 1980. It was Fortran-IV, punch cards and an old IBM/360 computer :)

Though I have never made any money by writing programs...

Link to comment

So, this prompts a follow up question.  How to most users edit files like /boot/config/go remotely?

 

My unraid server is sitting in a closet, so it seems the options are

- copy file to location on shared disks, edit, copy it back

- sneaker net the usb to my desktop, edit, sneaker net back

- use vi

 

Am I missing some easier way?  I just get by in vi, so not love lost ;-)

 

I too can get around in vi if I have to, but would rather not.  My personal favorite for years has been 'jove' (Jonathan's Own Version of Emacs).  It's not a full implementation of Emacs but has more than enough for everyday use and programming, plus it's small and fast and can be built for most any unix-like os.  Works well over putty or even telnet in a windows cmd window.

 

Of course, the command set is all emacs, which some would also say is an acquired taste...

 

Look for jove-4.16.0.61-i386-1.tgz or newer.

 

--Bill

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.