neovim / neovim

Vim-fork focused on extensibility and usability
https://neovim.io
Other
82.48k stars 5.64k forks source link

HOME and END does not work properly in neovim in tmux in FreeBSD 12.1 #13292

Open pepoluan opened 3 years ago

pepoluan commented 3 years ago

Note: Neovim installed using pkg install neovim, not from ports.

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info

- `vim -u DEFAULTS` (version: ) behaves differently?

> I am not using vim, but HOME & END works properly in `zsh`, in `tmux`, and in `nano`

- Operating system/version:

freebsd-version [12:46:12]

12.1-RELEASE


- Terminal name/version:

> KiTTY v0.74.2.5p @ 09/10/2020-17:13:24(GMT)
>
> (KiTTY is a fork of PuTTY)

- `$TERM`:

>  - `putty-256color` in zsh outside tmux
>  - `tmux-256color` in zsh _inside_ tmux

### Steps to reproduce using `nvim -u NORC`

nvim -u NORC

Alternative for shell-related problems:

env -i TERM=ansi-256color "$(which nvim)"



### Actual behaviour

Home & End key do not move the cursor.

### Expected behaviour

Home & End key should move the cursor to the beginning and end of line, respectively.

`infocmp` output attached:

* [infocmp-putty-256color.txt](https://github.com/neovim/neovim/files/5540263/infocmp-putty-256color.txt)
* [infocmp-tmux-256color.txt](https://github.com/neovim/neovim/files/5540264/infocmp-tmux-256color.txt)
erw7 commented 3 years ago

unibilium is unable to handle terminfo stored in hashed database (On FreeBSD, terminfo is stored in a hashed database). Thus there are some terminals on FreeBSD where the Home and End etc keys will not work even if terminfo (result of infocmp) and TERM environment variables are correct.

There are two workarounds.

  1. In PuTTY (KiTTY), set Terminal -> Keyboard -> The Home and End keys to rxvt, and then use neovim to do :noremap <kHome> <End> (The Home key works without setting the map).
  2. Copy the termininfo stored in the directory tree of Linux or MSYS2 etc. to $HOME/.termininfo (You only need to copy the entries you need).