All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
Key binding issues (vim through interix)
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login  |
|
|
Key binding issues (vim through interix) - Aug. 24, '06, 2:22:00 PM
|
|
|
ariscol
Posts: 8
Joined: Aug. 23, '06,
Status: offline
|
Here's what I'm doing:
OS: XP with SFU, i've used pkg_update to get bash and openssh
terminal: Console2 for windows xp
So, I run console, use it to start up a bash shell, then I'm sshing to a linux server on my network.
If I type 'env' at that point, my TERM=Interix
When I edit a file with VIM, certain keys don't work: (my backspace and delete work fine)
numbers on the keypad
ctrl-arrow left or right
So my question is, how can I get these working?
Do I need to modify the vimrc? or the inputrc (bash)? or the exerc file?
And regardless of which of those I need to modify, I'm not clear on how to define the mappings. Can anyone help?
|
|
|
RE: Key binding issues (vim through interix) - Aug. 24, '06, 4:19:12 PM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
You're running vim on the Linux box.
It's likely the Linux box doesn't have a current curses terminal database
so it doesn't have an entry for Interix. So key codes are going from Interix
through the ssh connection, but the terminfo database on the Linux can't find
the mapping info.
The thing to do is add an entry in the terminfo database for Interix.
Grab on the Interix box the entry for "interix" from /usr/share/terminfo.src
and put it on the Linux box. Then run tic filename.
That'll place it in the global database or your personal use database.
|
|
|
RE: Key binding issues (vim through interix) - Aug. 24, '06, 6:16:25 PM
|
|
|
ariscol
Posts: 8
Joined: Aug. 23, '06,
Status: offline
|
Ok, It took me a while, but I finally figured out what to do and did it.
Sadly, it didn't make any difference. My symptoms are the same. Let me clarify what my symptoms are:
(My symptoms listed above are a little off, I think I got mixed up between what was broken locally, and what was broken once I sshed to the other server)
at a bash command line (the server runs bash as well):
number pad works
backspace works
home works
end does NOT
delete does NOT (it deletes the character before the cursor, like backspace)
when I open VIM:
number pad works
backspace works
end works
home does NOT (acts funny, does something, but its waiting for more input)
delete does NOT (it draws ^?)
There may be other broken keys but I haven't found them.
I can't narrow this down. Is it a problem with my local bash setup? is it a problem with the remote bash setup? or is it a problem that should be resolved within VI? (probably not, i guess), I don't know where to begin.
|
|
|
RE: Key binding issues (vim through interix) - Aug. 24, '06, 6:34:42 PM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
The HOME key isn't mapped by default.
You can set a key mapping with "map <key> <action>".
The <key> gets done by a <ctrl-V><key> sequence.
The <action> can be as many sequences as you want.
So for the HOME key it should look like (that's a zero):
map ^[[H 0
|
|
|
RE: Key binding issues (vim through interix) - Aug. 24, '06, 6:50:58 PM
|
|
|
ariscol
Posts: 8
Joined: Aug. 23, '06,
Status: offline
|
Let me add as well that if I use my gentoo linux box and open a terminal and ssh to the same server, vi works fine, no key binding issues whatsoever.
And remember, I'm having issues at the bash prompt, not only in VI. I don't know that I couldn't solve the problem in VI, but I don't think it would be the right way...but then again, I'm the noob.
|
|
|
RE: Key binding issues (vim through interix) - Aug. 24, '06, 10:40:45 PM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
> Ok, It took me a while, but I finally figured out what to do and did it.
which was what?
|
|
|
RE: Key binding issues (vim through interix) - Aug. 24, '06, 11:03:39 PM
|
|
|
ariscol
Posts: 8
Joined: Aug. 23, '06,
Status: offline
|
I was referring to your terminfo suggestion.
I did what you said: I took the interix part from the terminfo.src on my local machine, copied it to the server, and ran "tic filename" to compile it into the database. It didn't give any errors or anything, it seemed to have run, but there were no changes to my symptoms (I tried closing the connection and reopening the terminal/bash, of course).
|
|
|
RE: Key binding issues (vim through interix) - Aug. 25, '06, 1:24:23 AM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
I think that there may be specific things done during your login that
are specific. I logged into a Linux box with an "interix" tty and an "xterm"
tty. The "interix" tty is recognized from my TERMINFO setting to ~/.terminfo.
The results were the same for me for both terminal types when used in
bash and with vim. Neither did anything with HOME or END keys.
It may be something special on that system when it sees certain terminal types
at login.
|
|
|
RE: Key binding issues (vim through interix) - Aug. 25, '06, 1:27:09 PM
|
|
|
ariscol
Posts: 8
Joined: Aug. 23, '06,
Status: offline
|
OK, Here's another question that might lead somewhere useful. If I open up a bash window to my local machine, whether it's just bash in the default cmd-type window, or whether I open bash in my terminal (console2), vim is messed up (delete, home, etc). Does it need to be working on my local machine before I can expect it to work through ssh?
|
|
|
RE: Key binding issues (vim through interix) - Aug. 25, '06, 1:52:54 PM
|
|
|
Rodney
Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
No, each works in isoloation on the machine it's running.
And vim isn't "messed up". There are no key mappings on a system wide
default for HOME, END, etc. because the escape codes will vary from terminal to terminal.
You can add it if you want to.
|
|
|
RE: Key binding issues (vim through interix) - Aug. 25, '06, 3:25:38 PM
|
|
|
ariscol
Posts: 8
Joined: Aug. 23, '06,
Status: offline
|
I've bitten off WAY more than I can chew here, and I think it's making it impossible for you to help me.
Let me back way way up.
I've just installed SFU. I used pkg_update to install bash. I open up bash and at the bash prompt, the delete key functions exactly like backspace. How can I make delete function like normal, i.e. delete the character UNDER the cursor?
EDIT: ok, in my ~/.inputrc I put "^?":delete-char
Now my delete functions properly on the bash command line. Now moving on to vim...(it didn't function properly there) I mapped it, :map ^? <Del> and :map! ^? <Del> and voila! Delete works in vim now too. (Note that ^? is not <shift-6><question mark>, it's a one character code that I typed simply by hitting delete).
Now, I'm having a heck of a time getting forward-word to work in bash (Let's not worry about vim just yet).
In my .inputrc I have a couple of lines that define forward word:
"\e\e[C": forward-word
"\e[5C": forward-word
niether of these work.
For the record, if I hit <ctrl-v> <right arrow> it inputs ^[[C for whatever that's worth. Any ideas on getting forward-word working in bash?
< Message edited by ariscol -- Aug. 25, '06, 5:48:28 PM >
|
|
|
RE: Key binding issues (vim through interix) - Aug. 25, '06, 6:32:07 PM
|
|
|
ariscol
Posts: 8
Joined: Aug. 23, '06,
Status: offline
|
I guess I should have posted a new comment instead of editing...
Any help?
Sorry to nag...
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
|
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|
|