Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1988474
  • 博文数量: 27
  • 博客积分: 10027
  • 博客等级: 上将
  • 技术积分: 1865
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-19 09:10
文章分类

全部博文(27)

文章存档

2010年(2)

2009年(3)

2008年(22)

分类: LINUX

2008-03-23 17:09:00

    这个问题是很古老的问题了,主要涉及到backspace键和delete键的键码映射问题。详细的理解部分可以参考:。
 

The keymapping problem can be traced back to the time when computers used punched tapes. The only way to correct a wrongly punched character was to punch additional bits in the tape (or rather, punch additional bits _out_ of the tape). Characters with all the bits punched were treated as deleted characters. See 'man ascii' for a list of the ASCII characterset, you'll see that DEL, (octal 177, decimal 127 and hexadecimal 7F) is the one with all the bits punched in (the ASCII code with the highest value). To be able to overwrite a character it is necessary to undo the feed between the characters first. For this the ASCII BS (octal 010, decimal 8, hexadecimal 08) was used. So to erase the last-typed character, you would have to press first BS to move back one character, and then DEL to delete the character. In newer computers either BS or DEL was chosen to move back and delete in one press.

 
    BS(BackSpace) == 0x08  == ^H
    DEL(DELete)  == 0x7F  == ^?
 
    现在host上已经很好的解决了这个问题,但是在嵌入式系统中,还是会出现这个问题,上述文章中提到的通用的解决办法不太适合嵌入式应用,所以暂行的解决办法有:根据你使用的终端,来重新设置码值映射关系。比如我现在使用的是SecureCRT,在会话选项-->映射键-->选中Backspace发送delete,那么在tinylogin和telnet登陆时,退格键就不会打印出^H,而是正常了。如果不修改,这时候backspace又不起作用,那么试一下ctrl+backspace.
阅读(3016) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~