LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (http://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Problem with remote terminal (ssh and PuTTY) (http://www.linuxquestions.org/questions/%2Absd-17/problem-with-remote-terminal-ssh-and-putty-125363/)

guardian653 12-12-2003 08:48 PM

Problem with remote terminal (ssh and PuTTY)
 
First off, I like to say that this forum kicks ass, quick responses and the responses are always helpful; it's got me to run FreeBSD as my server :)

This isn't a hugh problem but its increasingly becoming annoying. I know on my old RedHat box when connecting through PuTTY I have full use of the keyboard.. All the letters, function keys, HOME & END, insert delete, num pad etc.... along with full colors (simple things like `ls`)

I got to FreeBSD and it stops.. somewhat

After looking on the internet I found out that the color problem might be caused by the terminal type I setup, so after looking for a while (hehe while) I found a suitable term type vt220-color (the linux type causes lines to be draw as letters like p and b) and it does welll...

My keyboard isn't so much in line; for example I can't use the Home key.. instead of going to the beginning of the line I get a "~" whenever I use the num pad in nano I always get a notice, "NumLock glitch detected. Keypad will malfuction..."

Any help will be GREATLY appericated!!!

Thanks
Dave

taivu 12-12-2003 11:34 PM

I hate to post something I haven't tested myself, but trying this out won't break anything. The first part is what I have in my own .inputrc. The PuTTY part I found with Google and have no way of telling if it will work or not.

In .inputrc on the FreeBSD box add:
"\x7F": backward-delete-char
"\e[3~": delete-char
"\e[1~": beginning-of-line
"\e[4~": end-of-line

And in PuTTY's Configurations -> Terminal -> Keyboard set:
Backspace Key: Control-? (127)
Home and End keys: Standard
Function keys and keypad: Linux

Let us know if that worked.... or not.

guardian653 12-13-2003 02:33 PM

Alas, it didn't I'm still getting that damned "~" character on my bash shell
I'll try looking up more info about this (at least I know were to start looking..)

Any more idea though?

Thanks
Dave

taivu 12-14-2003 10:42 AM

Well, you got me curious so I went ahead and tested it as soon as I got access to a Windows machine. I hate to tell you this, but it worked just as it should when I ssh'd with PuTTY to my FreeBSD 4.9. Here are the settings (and a screenshot to show them):

Remote account on FreeBSD: settings already posted in the .inputrc

PuTTY: Backspace key to Control-? (127) and "Home and End keys" to Standard. No other changes (exept provinding host name and changing protocol to ssh).

After logging in home and end keys worked on the command line as they should, backspace deleted to the left and delete erased the character on top of it, just as these keys work in Windows (or Linux).

To test this further I created a brand new account, logged in with PuTTY (with the said settings) and experienced the "~" issue. Then I added the lines to .inputrc for that user and logged in again. Home, end, backspace and delete worked as expected.

I would appreciate if someone else would chime in since I really cannot figure out why it doesn't work for you.

taivu 12-14-2003 10:55 AM

Re: Problem with remote terminal (ssh and PuTTY)
 
Quote:

Originally posted by guardian653
After looking on the internet I found out that the color problem might be caused by the terminal type I setup, so after looking for a while (hehe while) I found a suitable term type vt220-color (the linux type causes lines to be draw as letters like p and b) and it does welll...
Hey, where did you set the vt220-color? I'm not very familiar with PuTTY and I didn't see that in the options... What version of PuTTY are you running? (Mine is 0.53b which, I believe, is the latest).

guardian653 12-14-2003 02:38 PM

To change your terminal type is done at the server side most of the time.

Add the following to your .bash_profile
TERM=vt220-color

or do it manually
export TERM=vt220-color

I'm using the same version if I remember right..

Any more clues?

Dave

RJW 12-14-2003 06:51 PM

I believe your issue isn't with PuTTY, but BASH. You may need to bind the keys in your `.profile' file.

taivu 12-14-2003 07:56 PM

Quote:

Originally posted by guardian653
To change your terminal type is done at the server side most of the time.
DUH.. I know that... I thought you were talking about PuTTY's terminal emulations. No wonder I couldn't find vt220-color there ;)

BTW, I just had an opportunity to access a fresh install of FreeBSD 4.9 with PuTTY and test the advice I gave in my first post. No other modifications done on the machine there, TERM was the default cons25 etc. I created the .inputrc and it gave me working backspace, delete, home and end - just as I expected.

Directory listing colors worked using ls -G.

I'm at loss here. If you have done a lot of testing trying to get the keys working, you may want to "go back your own trail" and see if the keys are being mapped in some other dotfile (or even the global ones in /etc).

I'm off to bed... hopefully someone comes along with a solution! Good night everyone!

guardian653 12-24-2003 04:39 AM

Well, other than the belated response (long story involving slackware), I was able to get it respond correctly. It seems that my bash profile was screwing everything up, so I simply deleted it. Added my .inputrc to my home and everything work out fine

Thanks for putting me in the right direction taivu, RJW :D

Dave

lichih 01-11-2005 11:31 PM

Have you tried these ?

bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line

nixcraft 01-12-2005 04:38 AM

Read this
http://www.cyberciti.biz/nixcraft/vi...orized-ls.html and link to script!
Also read old post on same issue http://www.linuxquestions.org/questi...hreadid=257114

etherdeath 02-09-2005 07:16 AM

I'm not sure if this will help you, but it worked for me :

In putty, under 'connection', set your terminal-type string to 'linux'.

I found this here :
http://lists.debian.org/debian-user/.../msg00853.html


All times are GMT -5. The time now is 07:48 PM.