2017-07-06 17:37 GMT+03:00 Linwei <[email protected]>:

> SecureCRT is a popular terminal software on Windows, just like iTerm on
> Mac OS X.
>
> I don't know what emulator are you using, I have checked all the emulators
> I known and came to the
> conclusion that <BS> is totally ASCII 127 (can also be refered as ^?) by
> default today:
>
> XShell:
> [image: vim_mapch_1]
> <https://user-images.githubusercontent.com/3035071/27914187-fbf229c6-6294-11e7-8265-dc3415a8d426.png>
>
> SecureCRT:
> [image: vim_mapch_2]
> <https://user-images.githubusercontent.com/3035071/27914306-50875ede-6295-11e7-8420-2e8bf1f946db.png>
>
> Putty:
> [image: vim_mapch_3]
> <https://user-images.githubusercontent.com/3035071/27914316-54e480b0-6295-11e7-99d1-edd6ecb1b034.png>
>
> Terminal on Mac OS X:
> [image: vim_mapch_4]
> <https://user-images.githubusercontent.com/3035071/27914326-58b2f8e8-6295-11e7-9765-406b668694f6.jpg>
>
> iTerm on Mac OS X:
> [image: vim_mapch_5]
> <https://user-images.githubusercontent.com/3035071/27914330-5b9684e4-6295-11e7-9b9a-936e10217a92.png>
>
> I have even tested in gnome-terminal and xterm on ubuntu and found that
> both of them send ASCII 127 (^?) for <BS>.
>
> Both of <BS> and ^H can delete a previous character on all the platforms,
> but they have different key code, so we can bind <c-h> to a new function
> without modifying the behavior of <BS> in Vim, eg:
>
> inoremap <c-h> <left>inoremap <c-j> <down>inoremap <c-k> <up>inoremap <c-l> 
> <right>
>
> These key mappings work fine in all the platform except windows console.
> Because ^H - ASCII 8 and ^? - ASCII 127 behave exactly the same way --
> deleting the previous character, in vim or shell.
>
> If we remap ^H to something new in vim, we can still use ^? (modern
> keycode for <BS>) to delete the last character, so remapping <c-h> works
> fine.
>
> But remapping <c-h> in windows console will destroy <BS>.
>
> That definitely matters a lot if you want to remap your <c-h>.
>

What do you want to do, exactly? Controlling what terminal sends is out of
Vim responsibility most of time, not possible sometimes. And as you have
shown above what <BS> sends is a *setting* on most terminals, Vim would not
adjust even those ​terminals’ settings you mentioned for various reasons,
starting from “it is hard to impossible (latter over ssh) to determine
which terminal emulator is being used” (not the case for Windows console),
proceeding to “adjusting such setting may mean breaking other applications,
so just assume user knows how to configure his terminal”.


> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/vim/vim/issues/1823#issuecomment-313415471>
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui