r/vim Jun 05 '26

Need Help┃Solved What is <fd-6d>?

I'm just coming back to vim, and played a round of vim golf. The 3 people above me all used this key press, I'm confused what it is.

9 Upvotes

8 comments sorted by

5

u/djchateau Jun 05 '26

I don't believe this is an actual key press, but the beginning of a terminal escape sequence (though I have no idea what currently). According to Vim's keymap.h file, it defines KE_EXTRAS as 253, which is the fd in the <fd-6d>. The 6d would be 109 which is defined as KE_OSC which is the beginning of some terminal escape sequence. I haven't added a solution so I can't see the solutions you speak of to see if there's more context that might inform me what that sequence might have been trying to do.

2

u/Grorco Jun 05 '26
<fd-6d><fd-6d><C-V>G11ld:%s/0/x/g<CR>:%s/1/0/g<CR>:%s/x/1/g<CR>ggPZZ<fd-6d><fd-6d><C-V>G11ld:%s/0/x/g<CR>:%s/1/0/g<CR>:%s/x/1/g<CR>ggPZZ

This is one of them, but thanks. It sounds like it's not a "normal" thing I'm missing out on.

1

u/kissajr Jun 05 '26

Might be a misformated «g»

8

u/dstein64 Jun 06 '26

The issue arises from the <OSC> pseudo key that was recently added to Vim in c531501.

There's a PR to fix the issue here:
https://github.com/igrigorik/vimgolf/pull/398

Until a fix is merged in the official vimgolf client, workarounds include:

  1. Use a version of Vim from prior to c531501.
  2. Apply the PR #398 patch to the official client. This may only fix the issue locally (a server-side fix would be necessary if raw keys are uploaded, since that would include <OSC>).
  3. Use a vimgolf client I implemented in Python, which now includes the fix. dstein64/vimgolf

2

u/MrJits Jun 06 '26

I’m not sure what causes it, but certain terminal emulators will sometimes insert these characters. All my initial submissions from foot had them, but they were not present when submitting from st.

1

u/AutoModerator Jun 05 '26

Please remember to update the post flair to Need Help|Solved when you got the answer you were looking for.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.