1 |
On Sunday 13 May 2007 21:12, Mick wrote: |
2 |
|
3 |
> I've tried bind -p | grep history and it did not work: |
4 |
> ========================================== |
5 |
> $ sudo bind -p | grep history |
6 |
> Password: |
7 |
> sudo: bind: command not found |
8 |
> ========================================== |
9 |
|
10 |
bind is a builtin bash command, I'm not sure about how it behaves when |
11 |
invoked by sudo. However, it should work fine even when run as a regular |
12 |
user. |
13 |
|
14 |
> I also tried changing the terminal once I logged in to the remote |
15 |
> machine, but I am getting the same error: |
16 |
> ========================================== |
17 |
> $ export TERM=vt100 |
18 |
> $ ^[[B^[[B |
19 |
> ========================================== |
20 |
> |
21 |
> What else could I try? |
22 |
|
23 |
Could it possibly be related to the readline library and the inputrc |
24 |
file? It seems that some keys are undefined on the machine you are |
25 |
sshing to. In the case of the left arrow (but of course this holds for |
26 |
any key that is not working as expected), try |
27 |
|
28 |
$ bind -q backward-char |
29 |
|
30 |
on both boxes. On my computer, it outputs |
31 |
|
32 |
backward-char can be invoked via "\C-b", "\eOD", "\e[D". |
33 |
|
34 |
Of these, "\e[D" is the one that corresponds to the "left arrow" key. |
35 |
|
36 |
If your output for the non-working computer is different, then it means |
37 |
that the left arrow key is not bound to the same function (or is not |
38 |
bound at all). This could be due to a ~/.inputrc file that redefines |
39 |
some keys. See man bash, section READLINE to get more info about |
40 |
readline. (BTW, there are *lots* of things that can be customized |
41 |
regarding readline behavior, and creating your own inputrc file can be a |
42 |
great learning experience - or at least, it was for me when I did it for |
43 |
LFS). Verify that you are using the same editing mode (usually emacs) on |
44 |
both boxes, with the command |
45 |
|
46 |
set -o | grep '^vi\|^emacs' |
47 |
|
48 |
Check whether the INPUTRC environment variable points to some file. On |
49 |
gentoo, bash does not read /etc/inputrc, but perhaps on ubuntu it does. |
50 |
|
51 |
As a last resort, you can try to create your own ~/.inputrc on the ubuntu |
52 |
box and put there all the key bindings you need (using CTRL+V + key to |
53 |
find out the correct values, as suggested in the comments at the |
54 |
beginning of gentoo /etc/inputrc, or copying them directly from the |
55 |
gentoo output of bind -p). |
56 |
-- |
57 |
gentoo-user@g.o mailing list |