当前位置: 首页 > news >正文

In VI, when an arrow key is pressed, a character (e.g. “A“) is sent.

That usually happens when vi is running in a mode that doesn’t understand your terminal’s arrow key escape sequences.

Here’s why:

  • Arrow keys don’t send a single character; they send an escape sequence (for example, the Up arrow sends ESC [ A).

  • If vi (or more commonly the very old ex/vi implementation, not vim) doesn’t recognize these escape sequences, it just displays the trailing characters like A, B, C, D (or sometimes M) instead of moving the cursor.

Common reasons

  1. You’re actually running vi, not vim.
    Some minimal Linux/Unix systems only ship with the original BSD vi, which lacks proper arrow key support.

  2. Terminal type mismatch.
    If your $TERM environment variable is wrong (e.g., set to dumb instead of xterm-256color), vi doesn’t know how to interpret escape sequences.

  3. Insert mode vs command mode.

    • In command mode, arrows usually work.

    • In insert mode, some old vi versions don’t handle them and show A, B, etc.

Fixes

  • Use vim instead of vi:

    sudo apt install vim      # Ubuntu/Debian
    sudo yum install vim      # RHEL/CentOS
    
  • Check your terminal type:

    echo $TERM
    

    If it says dumb, set it properly:

    export TERM=xterm-256color
    

http://www.dtcms.com/a/399589.html

相关文章:

  • pytorch工具箱(二)
  • css `isolation: isolate`
  • 杭州企业网站制作西安 网站开发
  • 数据结构算法真题
  • 容桂网站建设联系方式触屏网页界面设计
  • 网站设计方案公司建设免费网站制作
  • 国产CAD皇冠CAD(CrownCAD)三维建模教程:汽车水泵
  • 网站建设存在问题整改报告网站常用图标素材
  • 【Redis】缓存击穿、缓存穿透、缓存雪崩的解决方案
  • 东营外贸型网站设计怎么做点图片链接网站
  • 网站是怎么做wordpress. 说说样式
  • 2025年最新开源Nano Banana Plus商业化系统本地搭建教程
  • Redis 缓存三大坑:击穿、穿透、雪崩的解析与解决
  • 周口网站关键词优化制作静态动漫网站模板
  • 网站建设制作价格低分类信息专做宠物的网站
  • 【Linux网络】Socket编程:UDP网络编程实现Echo Server
  • 15.Linux 逻辑卷管理、交换空间管理及系统启动管理
  • DeepSeek-V3.1-Terminus深度解析:语言一致性、Agent能力增强,“终极版本“来了?
  • 常州商城网站制作公司2013影响网站百度搜索排名关键因素统计
  • 西安网站优化体验青白江区城乡和建设局网站
  • 社区医疗服务系统的设计与实现
  • 内存屏障与设备内存属性完全指南
  • 基于verilog的轮询调度器
  • 网站权重排名百度网盟如何选择网站
  • 邯郸营销网站建设公司哪家好安徽建设厅考勤网站
  • Spring 框架详细入门知识点
  • Shell常用快捷键和常用文件操作命令
  • 优秀设计网站大全电子商务网站开发环境示范
  • 在随钻测量的演进史中,陀螺为什么是关键角色?
  • seo网站排名全选网站建设工作情况总结