Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Secure Shell

Reply
 
Thread Tools Display Modes
  #1  
Old 06-21-2018, 09:22 PM
1003518805 1003518805 is offline
Registered User
 
Join Date: Jun 2018
Posts: 1
Question Why is it so abnormal with alt key ?

Firstly, it's absolutly normal in Xshell.


My vimrc:
inoremap <ESC>i <Up>
inoremap <ESC>k <Down>
inoremap <ESC>j <Left>
inoremap <ESC>l <Right>

Expected Result:
In connection of ssh with vim, I want to map alt key to move forward cursor in vim's insert mod.
Press alt and 'i' and holding on to reach the effect.

Actually result:
Vim show chaos

Otherthing had try:
1.I had setted "use alt as meta key" and checked "send escape for meta key"
2.I use bash cmd "showkey -a" to show input sequence
$ showkey -a
Press any keys - Ctrl-D will terminate this program
//press alt+i
^[ 27 0033 0x1b
i 105 0151 0x69 //abnormal
^[ 27 0033 0x1b //abnormal
i 105 0151 0x69
^[i 27 0033 0x1b
105 0151 0x69
^[ 27 0033 0x1b //abnormal
i 105 0151 0x69 //abnormal
^[ 27 0033 0x1b //abnormal
i 105 0151 0x69 //abnormal
^[ 27 0033 0x1b //abnormal
i 105 0151 0x69 //abnormal
^[i 27 0033 0x1b
105 0151 0x69


Contrastive result:
It's absolutly normal in Xshell.

$ showkey -a
Press any keys - Ctrl-D will terminate this program
//press alt+i
^[i 27 0033 0x1b
105 0151 0x69
^[i 27 0033 0x1b
105 0151 0x69
^[i 27 0033 0x1b
105 0151 0x69
^[i 27 0033 0x1b
105 0151 0x69
^[i 27 0033 0x1b
105 0151 0x69
^[i 27 0033 0x1b
105 0151 0x69
^[i 27 0033 0x1b
105 0151 0x69
^[i 27 0033 0x1b


Please help me check.
Reply With Quote
  #2  
Old 06-22-2018, 09:38 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hello,

I'm sorry you're having trouble. Can you elaborate on "Vim show chaos", what does that mean?

In my testing, adding those four lines to vimrc allows Alt-i, Alt-j etc to work as expected. I believe the differences in the showkey output is a function of timing. The showkey man page states the following:

Quote:
A new line is printed when an interval of about 0.1 seconds occurs between the bytes received
I believe the "i" being on a separate line is simply a matter of .1 seconds passing between the escape sequence and the "i".
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 06:48 AM.