LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Cant get the arrow keys to work properly :( (https://www.linuxquestions.org/questions/%2Absd-17/cant-get-the-arrow-keys-to-work-properly-410259/)

fraggelfraggel 01-31-2006 11:41 PM

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

taylor_venable 02-01-2006 01:17 PM

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").

fraggelfraggel 02-01-2006 01:28 PM

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").


Stack 02-01-2006 09:03 PM

What is your TERM env set to?

fraggelfraggel 02-01-2006 09:24 PM

"xterm" if using

->echo $TERM

is the right way to find out

Quote:

Originally Posted by Stack
What is your TERM env set to?


Stack 02-02-2006 12:18 AM

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...

fraggelfraggel 02-02-2006 12:49 AM

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 :confused: 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


All times are GMT -5. The time now is 03:06 PM.