LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
Search this Thread
Old 01-31-2006, 11:41 PM   #1
fraggelfraggel
LQ Newbie
 
Registered: Oct 2005
Posts: 8

Rep: Reputation: 0
Cant get the arrow keys to work properly :(


When logging in remotely and then "su - root", getting a prompt using "/bin/sh", I can use my arrow keys to navigate the command history and also move back and forth in the prompt. However if I dont su - root I still am using the "/bin/sh" but here I only get [[^A character when pressing the left key for example and I have no command history.

The system also says Terminal type xterm when I "su - root",
I have tried searching the whole web and also my system for something that could help me fix this but without any luck

PLEASE HELP ME!!!!

/fraggelfraggel

Last edited by fraggelfraggel; 02-01-2006 at 12:23 AM.
 
Old 02-01-2006, 01:17 PM   #2
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 40
I didn't think "sh" had command history. I think what's happening is that when you "su" to root you're actually still using your original user's shell, which may be tcsh or whatever.

Unless you really need to use "sh" for your root shell, you could just switch to "tcsh" (run "chsh" as root). Or install bash (/usr/ports/shells/bash) and use it (again, run "chsh").
 
Old 02-01-2006, 01:28 PM   #3
fraggelfraggel
LQ Newbie
 
Registered: Oct 2005
Posts: 8

Original Poster
Rep: Reputation: 0
same problem using csh

my normal user i log in with is using csh now, but I still have the same problem. Getting this when using arrow keys in the prompt:

machine: {12} [D^[
machine: {12} [DC[^[
machine: {12} [DC[B[^[
machine: {12} [DC[B[A[

and I also got no command history.

Quote:
Originally Posted by taylor_venable
I didn't think "sh" had command history. I think what's happening is that when you "su" to root you're actually still using your original user's shell, which may be tcsh or whatever.

Unless you really need to use "sh" for your root shell, you could just switch to "tcsh" (run "chsh" as root). Or install bash (/usr/ports/shells/bash) and use it (again, run "chsh").
 
Old 02-01-2006, 09:03 PM   #4
Stack
Member
 
Registered: Oct 2003
Distribution: FreeBSD
Posts: 325

Rep: Reputation: 30
What is your TERM env set to?
 
Old 02-01-2006, 09:24 PM   #5
fraggelfraggel
LQ Newbie
 
Registered: Oct 2005
Posts: 8

Original Poster
Rep: Reputation: 0
"xterm" if using

->echo $TERM

is the right way to find out

Quote:
Originally Posted by Stack
What is your TERM env set to?
 
Old 02-02-2006, 12:18 AM   #6
Stack
Member
 
Registered: Oct 2003
Distribution: FreeBSD
Posts: 325

Rep: Reputation: 30
Well you either messed up something in your .cshrc(Post it) or you messed up your keylayout. Try changing your users shell to tcsh and then we will see what we can do. I am more familiar with tcsh :|

If you need to get this fixed asap head over to freebsdforums.org they get a lot more traffic and well your question will probably get answered faster.

PS: If your $TERM is xterm that might also be the cause of some problems...

Last edited by Stack; 02-02-2006 at 12:25 AM.
 
Old 02-02-2006, 12:49 AM   #7
fraggelfraggel
LQ Newbie
 
Registered: Oct 2005
Posts: 8

Original Poster
Rep: Reputation: 0
cshrc

Noticed that in my

/home/$user directory there was no ".cshrc" file, but
when I try to copy the skel file it ends up in /root/.cshrc but it didnt help anything.
If I use the bash shell there is no problems.

There is also one in /
I also have csh.cshrc in /etc/ they al look like the one below.

---------------------------------------------------------

#csh .cshrc file

alias h history 25
alias j jobs -l
alias la ls -a
alias lf ls -FA
alias ll ls -lA
alias su su -m

setenv EDITOR vi
setenv VISUAL ${EDITOR}
setenv EXINIT 'set autoindent'
setenv PAGER more

set path = (~/bin /bin /sbin /usr/{bin,sbin,X11R6/bin,pkg/{,s}bin,games} \
/usr/local/{,s}bin)

if ($?prompt) then
# An interactive shell -- set some stuff up
set filec
set history = 1000
set ignoreeof
set mail = (/var/mail/$USER)
set mch = `hostname -s`
set prompt = "${mch:q}: {\!} "
endif

Last edited by fraggelfraggel; 02-02-2006 at 12:50 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Numeric keypad arrow keys arielgr Linux - Newbie 2 08-23-2005 10:04 AM
VIM and the arrow keys Buto Linux - Software 1 09-16-2004 07:38 PM
Arrow keys in nethack Levitate Linux - Games 3 08-22-2004 11:44 AM
Flash apps and arrow keys jinksys Linux - General 3 03-04-2004 07:17 PM
Arrow keys dont work in JAVA under GNOME budhusa Linux - Hardware 1 02-08-2004 11:37 AM


All times are GMT -5. The time now is 08:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration