macvim-dev / macvim-dev/macvim

What exactly pressing <F13> sends?

Open
#1,220 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
7.9k
Forks
691
PR merge metrics
No merged PRs in 30d

Description

I have <Eject> key mapped to <F13> with Karabiner-Elements. And if tested in Terminal.app or Alacritty.app, it correctly reports ^[[25~

However, in MacVim, if I :terminal cat, and then press <F11>, <F12> and then <F13>, I see ^[[23~, ^[[24~, and then just some sort of space (the cursor moves one position to the right, while reporting nothing):

It does work OK, though, I can create mappings with <F13>. But if I use some TUI application in :terminal, then it clearly doesn't understand it.

:set t_F3 or :set <F13> both report E846: Key code not set. Trying to actually set those to ^[[25~ makes no effect (:terminal cat still reports that mysterious space). Reproducible on the latest release.

Any hints may be? :)

Well, tnoremap <F13> ^[[25~ seems to solve the problem :). But still, what exactly does it send by default?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in MacVim with :terminal cat, comparing F11, F12, and F13 against Terminal.app or Alacritty.app. Investigate how MacVim handles F13 in the embedded terminal and verify whether tnoremap ^[[25~ changes the result; done means identifying the default sequence or correcting the discrepancy.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, vim
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.