microsoft / microsoft/terminal
Editing WT actions can silently break them
@PankajBhojwani is already working on this.
Since Nov 11, 2025.
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
### 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:
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!
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:
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.
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.