Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In latest VSCode insiders, typing text fast breaks with Karabiner (crucial for my workflow to work) #192707

Closed
nikitavoloboev opened this issue Sep 10, 2023 · 8 comments
Assignees

Comments

@nikitavoloboev
Copy link

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version:

Version: 1.83.0-insider
Commit: b257cce
Date: 2023-09-08T17:38:26.218Z
Electron: 25.8.0
ElectronBuildId: 23503258
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 22.5.0

Steps to Reproduce:

  1. download https://karabiner-elements.pqrs.org
  2. inside ~/.config/karabiner/karabiner.json put this JSON:
{
  "global" : {
    "ask_for_confirmation_before_quitting" : true,
    "check_for_updates_on_startup" : true,
    "show_in_menu_bar" : true,
    "show_profile_name_in_menu_bar" : false,
    "unsafe_ui" : false
  },
  "profiles" : [ {
    "complex_modifications" : {
      "parameters" : {
        "basic.simultaneous_threshold_milliseconds" : 30,
        "basic.to_delayed_action_delay_milliseconds" : 0,
        "basic.to_if_alone_timeout_milliseconds" : 80,
        "basic.to_if_held_down_threshold_milliseconds" : 50
      },
      "rules" : [ {
        "description" : "test",
        "manipulators" : [ {
          "from" : {
            "key_code" : "a"
          },
          "to" : [ {
            "key_code" : "c"
          }, {
            "key_code" : "o"
          }, {
            "key_code" : "n"
          }, {
            "key_code" : "s"
          }, {
            "key_code" : "o"
          }, {
            "key_code" : "l"
          }, {
            "key_code" : "e"
          }, {
            "key_code" : "period"
          }, {
            "key_code" : "l"
          }, {
            "key_code" : "o"
          }, {
            "key_code" : "g"
          }, {
            "key_code" : "9",
            "modifiers" : [ "left_shift" ]
          }, {
            "key_code" : "0",
            "modifiers" : [ "left_shift" ]
          }, {
            "key_code" : "left_arrow"
          } ],
          "conditions" : [ {
            "name" : "dot-mode",
            "value" : 1,
            "type" : "variable_if"
          } ],
          "type" : "basic"
        }, {
          "type" : "basic",
          "parameters" : {
            "basic.simultaneous_threshold_milliseconds" : 250
          },
          "to" : [ {
            "set_variable" : {
              "name" : "dot-mode",
              "value" : 1
            }
          }, {
            "key_code" : "c"
          }, {
            "key_code" : "o"
          }, {
            "key_code" : "n"
          }, {
            "key_code" : "s"
          }, {
            "key_code" : "o"
          }, {
            "key_code" : "l"
          }, {
            "key_code" : "e"
          }, {
            "key_code" : "period"
          }, {
            "key_code" : "l"
          }, {
            "key_code" : "o"
          }, {
            "key_code" : "g"
          }, {
            "key_code" : "9",
            "modifiers" : [ "left_shift" ]
          }, {
            "key_code" : "0",
            "modifiers" : [ "left_shift" ]
          }, {
            "key_code" : "left_arrow"
          } ],
          "from" : {
            "simultaneous" : [ {
              "key_code" : "period"
            }, {
              "key_code" : "a"
            } ],
            "simultaneous_options" : {
              "detect_key_down_uninterruptedly" : true,
              "key_down_order" : "strict",
              "key_up_order" : "strict_inverse",
              "key_up_when" : "any",
              "to_after_key_up" : [ {
                "set_variable" : {
                  "name" : "dot-mode",
                  "value" : 0
                }
              } ]
            }
          }
        } ]
      } ]
    },
    "devices" : [ {
      "disable_built_in_keyboard_if_exists" : false,
      "fn_function_keys" : [ ],
      "identifiers" : {
        "is_keyboard" : true,
        "is_pointing_device" : false,
        "product_id" : 834,
        "vendor_id" : 1452
      },
      "ignore" : false,
      "manipulate_caps_lock_led" : true,
      "simple_modifications" : [ ],
      "treat_as_built_in_keyboard" : false
    }, {
      "disable_built_in_keyboard_if_exists" : false,
      "fn_function_keys" : [ ],
      "identifiers" : {
        "is_keyboard" : false,
        "is_pointing_device" : true,
        "product_id" : 834,
        "vendor_id" : 1452
      },
      "ignore" : true,
      "manipulate_caps_lock_led" : false,
      "simple_modifications" : [ ],
      "treat_as_built_in_keyboard" : false
    }, {
      "disable_built_in_keyboard_if_exists" : false,
      "fn_function_keys" : [ ],
      "identifiers" : {
        "is_keyboard" : true,
        "is_pointing_device" : false,
        "product_id" : 34304,
        "vendor_id" : 1452
      },
      "ignore" : false,
      "manipulate_caps_lock_led" : true,
      "simple_modifications" : [ ],
      "treat_as_built_in_keyboard" : false
    } ],
    "fn_function_keys" : [ {
      "from" : {
        "key_code" : "f1"
      },
      "to" : [ {
        "consumer_key_code" : "display_brightness_decrement"
      } ]
    }, {
      "from" : {
        "key_code" : "f2"
      },
      "to" : [ {
        "consumer_key_code" : "display_brightness_increment"
      } ]
    }, {
      "from" : {
        "key_code" : "f3"
      },
      "to" : [ {
        "apple_vendor_keyboard_key_code" : "mission_control"
      } ]
    }, {
      "from" : {
        "key_code" : "f4"
      },
      "to" : [ {
        "apple_vendor_keyboard_key_code" : "spotlight"
      } ]
    }, {
      "from" : {
        "key_code" : "f5"
      },
      "to" : [ {
        "consumer_key_code" : "dictation"
      } ]
    }, {
      "from" : {
        "key_code" : "f6"
      },
      "to" : [ {
        "key_code" : "f6"
      } ]
    }, {
      "from" : {
        "key_code" : "f7"
      },
      "to" : [ {
        "consumer_key_code" : "rewind"
      } ]
    }, {
      "from" : {
        "key_code" : "f8"
      },
      "to" : [ {
        "consumer_key_code" : "play_or_pause"
      } ]
    }, {
      "from" : {
        "key_code" : "f9"
      },
      "to" : [ {
        "consumer_key_code" : "fast_forward"
      } ]
    }, {
      "from" : {
        "key_code" : "f10"
      },
      "to" : [ {
        "consumer_key_code" : "mute"
      } ]
    }, {
      "from" : {
        "key_code" : "f11"
      },
      "to" : [ {
        "consumer_key_code" : "volume_decrement"
      } ]
    }, {
      "from" : {
        "key_code" : "f12"
      },
      "to" : [ {
        "consumer_key_code" : "volume_increment"
      } ]
    } ],
    "name" : "goku",
    "parameters" : {
      "delay_milliseconds_before_open_device" : 1000
    },
    "selected" : true,
    "simple_modifications" : [ {
      "from" : {
        "key_code" : "caps_lock"
      },
      "to" : [ {
        "key_code" : "escape"
      } ]
    } ],
    "virtual_hid_keyboard" : {
      "country_code" : 0,
      "indicate_sticky_modifier_keys_state" : true,
      "mouse_key_xy_scale" : 100
    }
  } ]
}

Then go open VSCode Insiders and press on dot key then press a. You should see this written out:

image

Instead you will see this on VSCode Insiders:

image

This only happens in VSCode Insiders.

In normal VSCode it works correctly. As seen below:

image

I don't know what happened on latest insiders but this breaking is a huge deal breaker for me. Please revert the change.

It seems VSCode Insiders broke entering symbols into the editor fast or something.

Thank you.

nikitavoloboev referenced this issue Sep 10, 2023
…#192638)

The idea here is... if a token is currently being refreshed, well then getting a token of those scopes should wait for that to finish.

Core has a really nice `SequencerByKey` for exactly this kind of thing, and so I've stolen that and started to organize the code with a `common` folder.

Oh, I also noticed we were sorting twice and fixed that to only sort once.

ref #186693
@nikitavoloboev
Copy link
Author

nikitavoloboev commented Sep 10, 2023

image

If I do this macro in https://www.keyboardmaestro.com/main/

It also will mess up.

image

Basically something you've done to editor that completely messes up typing symbols fast. It just eats some symbols completely.

Please please revert this change.

@nikitavoloboev
Copy link
Author

Just to prove its issue with latest VSCode. Here is me doing same action (Karabiner or KM macro insert by typing action)

In sublime text:

image

In Warp terminal:

image

Literally all other inputs it works. Just VSCode breaks. Maybe some update to monaco editor breaks it?

@nikitavoloboev
Copy link
Author

nikitavoloboev commented Sep 10, 2023

Also to prove its a regression with latest VSCode and not any other software, here I try use the insert text by typing in https://www.cursor.sh

image

As can be seen it enters it correctly.

Cursor uses old VSCode version and it works.

@nikitavoloboev
Copy link
Author

nikitavoloboev commented Sep 10, 2023

From scanning the latest commits, I think this commit can be the cause

41e940f

But I can't be sure.

It's a huge part of my workflow to be able to enter text with typing using programs like KM or Karabiner so please help me resolve the issue.

Thank you lots.

@nikitavoloboev
Copy link
Author

nikitavoloboev commented Sep 10, 2023

Ok this is a deeper issue.

When I type things normally in VSCode, occasionally VSCode just eats the symbols. I can replicate it 100% of times.

image

For example, I was just typing normally there.

Specifically I can replicate it when I type t followed by h. The h will never show up. VSCode will not let me enter the symbol.

If I type h alone it works.

This is a huge regression as you can imagine.

Is my env setup:

Version: 1.83.0-insider
Commit: https://github.com/microsoft/vscode/commit/b257cce9e7fa2d5f475ac16c15b40280d0b97957
Date: 2023-09-08T17:38:26.218Z
Electron: 25.8.0
ElectronBuildId: 23503258
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 22.5.0

I can provide any further details needed to resolve it. Thank you and I hope this can be resolved soon.

This happens with Karabiner Elements active. But this also only happens in VSCode with Karabiner.

Every other app works correctly with Karabiner.

image

For example above is Notes app. It works well and with Karabiner on. However with Karabiner on and in VSCode after typing the the the I get this:

image

I don't know exactly what happened to either VSCode or Karabiner but basically characters are getting eaten when I type th fast enough.

@nikitavoloboev
Copy link
Author

image

Tested it on Monaco editor and things worked. It's something with VSCode app itself thats breaking.

@nikitavoloboev
Copy link
Author

Ok I think the issue is with Karabiner Elements latest version, not VSCode as tested on a separate mac.

Described it here: pqrs-org/Karabiner-Elements#3595 (comment)

Will keep the issue open until @tekezo replies. In case he will need information from VSCode team to fix the issue for latest Karabiner version.

@DonJayamanne
Copy link
Contributor

Ok I think the issue is with Karabiner Elements latest version, not VSCode as tested on a separate mac.

thank you
I’m closing this issue as you have confirmed it’s not related to vscode
There are other means of communication other than just leaving this issue open

@github-actions github-actions bot locked and limited conversation to collaborators Oct 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants