Skip to content

Ignore \xfd\x6d Focus keys#398

Open
Str8Razor wants to merge 2 commits intoigrigorik:masterfrom
Str8Razor:master
Open

Ignore \xfd\x6d Focus keys#398
Str8Razor wants to merge 2 commits intoigrigorik:masterfrom
Str8Razor:master

Conversation

@Str8Razor
Copy link

@Str8Razor Str8Razor commented Dec 19, 2025

Vimgolf already filter out some vim window focus keys.
I am adding one more that is missing.
Without it the output is: "Here are your keystrokes: fd-6d fd-6d:q".
This will fix the client side only. And should be apply to server side as well.

@GamesByFelix
Copy link

Is there a workaround for this problem while this is not merged yet?

@Str8Razor
Copy link
Author

Str8Razor commented Jan 13, 2026

@GamesByFelix
This patch will just clean keystrokes string that vimgolf shows you after a challenge has been completed.
Until it will be fixed on server side, keystrokes string that is submitted to server should be filtered as well.
To do this you need to add these 2 lines to /usr/lib/ruby/gems/3.4.0/gems/vimgolf-0.5.0/lib/vimgolf/cli.rb

    def upload?(challenge)
+      VimGolf.ui.warn "Cleaning up input keys..."
+      %x( sed -i -e 's/\x80\xfd\x6d//g' #{challenge.log_path} )

      VimGolf.ui.warn "Uploading to VimGolf..."

@dstein64
Copy link
Contributor

dstein64 commented Feb 1, 2026

I believe the issue arose from the <OSC> pseudo key that was recently added to Vim in c531501.

Before vimgolf is updated, using a version of Vim without that commit should resolve the issue.

"This patch will just clean keystrokes string that vimgolf shows you after a challenge has been completed."

@Str8Razor, I believe your PR fully addresses the issue client-side (I interpreted your comment as suggesting otherwise). That is, I think the patch in your PR can be used to work around the issue without server-side changes (for new submissions; I'm not sure about submissions already made that included the extra keys). Update: I see in your PR description that you say "This will fix the client side only. And should be apply to server side as well."

I applied the same type of fix to dstein64/vimgolf (a vimgolf Python client I implemented) after receiving Issue #8.

@dstein64 Yes, you are right.

Co-authored-by: Daniel Steinberg <dstein64@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants