Editing WT actions can silently break them #23709

Open
opened 2026-01-31 08:50:02 +00:00 by claunia · 3 comments
Owner

Originally created by @alabuzhev on GitHub (Oct 16, 2025).

Originally assigned to: @PankajBhojwani on GitHub.

Windows Terminal version

1.25.251014001-llm

Windows build number

10.0.19045.6332

Other Software

No response

Steps to reproduce

  1. Open WT

  2. Settings - Actions

  3. Remove all the predefined actions (It can take a while, yes. Perhaps it would make sense to have an Action for that as well? :) )

  4. Press Add new

  5. Make sure your keyboard layout is US English.

  6. Type / (should be close to right Shift)

  7. Press Accept.

  8. Press Save.

  9. You should see it now:
    Image

  10. Add a keyboard layout with a different placement of /, e.g. Ukrainian.

  11. Switch to that layout.

  12. Suddenly wild "Open default settings file (JSON)" and "Open settings file (JSON)" actions appear!
    Image
    Why? I didn't ask for them. I explicitly removed everything. Why my choices are not respected?

  13. Notice that / is now suddenly called shift+\.
    However, it makes sense if you look at the layout again - it is in the upper case of the \ key close to Enter, so it is shift+\ indeed:
    Image
    Which is kinda cool: WT is smart enough and user-friendly enough to show me what exactly we need to type now in this particular layout to get what we want. Nice. What could possibly go wrong, right?

  14. But there are still those two sudden actions we haven't asked for. Probably it's some bug in WT, but it's not a big deal, we can just remove them manually.

  15. Press Edit - Delete - Yes on each.

  16. Press Save.
    Image

  17. Switch back to US English layout.

Expected Behavior

The action I've added should change back to /, same as it did before I removed those two extra actions.
It should trigger when I press / in US English (the key close to right Shift).

Actual Behavior

The action I've added does not change back to / when I switch to US English. It stays shift+\.
Pressing / in US English doesn't trigger it anymore.

If I open the json, it becomes obvious what happened:

    "keybindings": 
    [
        {
            "id": "User.addMark.0",
            "keys": "shift+\\"
        },
  • When I switched to a new layout, WT kindly converted the config keys to the physical keys of that layout that would've produced the same character if pressed.
  • When I made further changes while that layout was still active, WT persisted those physical keys to the config, as if I entered them manually, in the process losing the knowledge that those are not the keys I started from.

This, of course, can manifest in other, more probable scenarios: "switch the layout, add a new action, save, some key in the other layout is now broken" etc.

What can be done:

Mapping of keys between different layouts is not 1 to 1. It's one to many, or many to one, or many to many, or to none, can be anything since MSKLC exists, so conceptually it probably will always stay broken to some extent.

But maybe at least:

  • Try to not overwrite the keys the user have not touched while adding, removing, editing something else?
  • Fix those "Open default settings file (JSON)" and "Open settings file (JSON)" coming out of the blue?
Originally created by @alabuzhev on GitHub (Oct 16, 2025). Originally assigned to: @PankajBhojwani on GitHub. ### Windows Terminal version 1.25.251014001-llm ### Windows build number 10.0.19045.6332 ### Other Software _No response_ ### Steps to reproduce 1. Open WT 2. Settings - Actions 3. Remove all the predefined actions (It can take a while, yes. Perhaps it would make sense to have an Action for that as well? :) ) 4. Press Add new 5. Make sure your keyboard layout is [US English](https://kbdlayout.info/kbdus). 6. Type `/` (should be close to right Shift) 7. Press Accept. 8. Press Save. 9. You should see it now: <img width="197" height="147" alt="Image" src="https://github.com/user-attachments/assets/a5d12ad3-9d9b-4177-bf8d-3ad2452e9670" /> 10. Add a keyboard layout with a different placement of `/`, e.g. [Ukrainian](https://kbdlayout.info/kbdur). 11. Switch to that layout. 12. Suddenly wild "Open default settings file (JSON)" and "Open settings file (JSON)" actions appear! <img width="346" height="217" alt="Image" src="https://github.com/user-attachments/assets/324a5a19-555b-4a2d-8f3a-30d9af8d5c8f" /> Why? I didn't ask for them. I explicitly removed everything. Why my choices are not respected? 13. Notice that `/` is now suddenly called `shift+\`. However, it makes sense if you look at the [layout](https://kbdlayout.info/kbdur) again - it is in the upper case of the `\` key close to Enter, so it is `shift+\` indeed: <img width="177" height="162" alt="Image" src="https://github.com/user-attachments/assets/cd96a832-5b78-47ac-938a-ed0fb7fa4251" /> Which is kinda cool: WT is smart enough and user-friendly enough to show me what exactly we need to type now in this particular layout to get what we want. Nice. What could possibly go wrong, right? 14. But there are still those two sudden actions we haven't asked for. Probably it's some bug in WT, but it's not a big deal, we can just remove them manually. 15. Press Edit - Delete - Yes on each. 16. Press Save. <img width="202" height="130" alt="Image" src="https://github.com/user-attachments/assets/72578ef2-c1fc-4383-8fa1-15a90d35fb84" /> 17. Switch back to US English layout. ### Expected Behavior The action I've added should change back to `/`, same as it did before I removed those two extra actions. It should trigger when I press `/` in US English (the key close to right Shift). ### Actual Behavior The action I've added does not change back to `/` when I switch to US English. It stays `shift+\`. Pressing `/` in US English doesn't trigger it anymore. If I open the json, it becomes obvious what happened: ```json "keybindings": [ { "id": "User.addMark.0", "keys": "shift+\\" }, ``` - When I switched to a new layout, WT kindly converted the config keys to the physical keys of that layout that would've produced the same character if pressed. - When I made further changes _while that layout was still active_, WT persisted those physical keys to the config, _as if I entered them manually_, in the process losing the knowledge that those are not the keys I started from. This, of course, can manifest in other, more probable scenarios: "switch the layout, _add_ a new action, save, some key in the other layout is now broken" etc. ### What can be done: Mapping of keys between different layouts is not 1 to 1. It's one to many, or many to one, or many to many, or to none, can be anything since MSKLC exists, so conceptually it probably will always stay broken to some extent. But maybe at least: - Try to not overwrite the keys the user have not touched while adding, removing, editing something else? - Fix those "Open default settings file (JSON)" and "Open settings file (JSON)" coming out of the blue?
claunia added the Area-SettingsIssue-BugPriority-3Product-Terminal labels 2026-01-31 08:50:02 +00:00
Author
Owner

@kdt523 commented on GitHub (Oct 17, 2025):

Hi, I’d like to work on this issue . Could you please assign it to me?

@kdt523 commented on GitHub (Oct 17, 2025): Hi, I’d like to work on this issue . Could you please assign it to me?
Author
Owner

@lhecker commented on GitHub (Oct 17, 2025):

No, but you can work on it if you'd like.

@lhecker commented on GitHub (Oct 17, 2025): No, but you can work on it if you'd like.
Author
Owner

@DHowett commented on GitHub (Oct 22, 2025):

@PankajBhojwani You're not here in triage but I am assigning this one to you as our Actions Person 🙂. Enjoy the new bug!

@DHowett commented on GitHub (Oct 22, 2025): @PankajBhojwani You're not here in triage but I am assigning this one to you as our Actions Person 🙂. Enjoy the new bug!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23709