mtense Posted January 2, 2010 Share Posted January 2, 2010 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 Quote Link to comment
mtense Posted January 2, 2010 Author Share Posted January 2, 2010 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 Quote Link to comment
Joe L. Posted January 2, 2010 Share Posted January 2, 2010 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 Quote Link to comment
mtense Posted January 2, 2010 Author Share Posted January 2, 2010 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 Quote Link to comment
wholly Posted January 2, 2010 Share Posted January 2, 2010 Most users never connect directly to the server and edit files. Esp through vi which as you know is a "acquired taste". I installed openssh through unmenu and connect with putty and had no issues using vi (that I can remember). Quote Link to comment
mtense Posted January 2, 2010 Author Share Posted January 2, 2010 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 Quote Link to comment
Joe L. Posted January 2, 2010 Share Posted January 2, 2010 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. Quote Link to comment
mtense Posted January 2, 2010 Author Share Posted January 2, 2010 Doh, when I configured several weeks ago I chose not the export the flash drive b/c I couldn't think why I would need to at the time. Completely forgot it could be exported. That was the bit I was missing. Thanks for all the help!!! Quote Link to comment
yp_1 Posted January 2, 2010 Share Posted January 2, 2010 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 Quote Link to comment
Joe L. Posted January 2, 2010 Share Posted January 2, 2010 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" ) Joe l. It takes an old-timer (like me) to remember that "ex" exists. You must be OLD TOO!!!. Quote Link to comment
yp_1 Posted January 2, 2010 Share Posted January 2, 2010 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... Quote Link to comment
bblue Posted January 3, 2010 Share Posted January 3, 2010 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 Quote Link to comment
purko Posted January 3, 2010 Share Posted January 3, 2010 ...and for the rest of us, who are not so masochistically inclined, there's [ftp=ftp://slackware.osuosl.org/pub/slackware/slackware-13.0/slackware/ap/nano-2.0.9-i486-1.txz]nano[/ftp]. Quote Link to comment
Recommended Posts
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.