Thanks for the report. I'd like to nail this down but I need a bit more information to figure out what's happening, since literally pressing Control+2 on macOS sends NUL (0x00), not @, and shouldn't produce a bell or cursor movement. So I think there is either a missing piece in the setup or a non-obvious key combination involved. Could you help me with the following? I would recommend filing an issue at
https://iterm2.com/bugs so we can continue the conversation without making too much noise on the list.
1. macOS version (Apple menu → About This Mac, full version including the build, e.g. 26.5 (25F71)).
2. Your iTerm2 plist. Please email ~/Library/Preferences/com.googlecode.iterm2.plist to
gnac...@gmail.com with the issue number in the subject line. It may contain private settings, so email is preferred over attaching it to a public issue.
3. Is Spanish actually installed as an input source on the system? Open System Settings → Keyboard → Text Input → Input Sources → Edit, and confirm that the Spanish keyboard layout you want appears in the list. The iTerm2 "Force Keyboard" feature asks macOS to switch to that input source, so if Spanish is not in the list, the setting cannot do anything. If it is in the list, please tell
me which exact entry you chose (for example "Spanish ISO", "Spanish", "Spanish Latin American", etc.).
4. A debug log of one bad keypress. This is the most useful single piece of information:
- Quit iTerm2 and relaunch it.
- From the menu bar, choose Debug → Toggle Debug Logging.
- Open a new shell window, press the @ key (or }, whichever is easiest to reproduce) one time.
- Choose Debug → Toggle Debug Logging again to stop. It will save /tmp/debuglog.txt.
- Attach that file here (or email it).
5. Which physical key and which modifier are you actually pressing? When you say "Control + 2", do you mean:
- The key labeled "Control" (sometimes "Ctrl") plus the number 2, or
- The key labeled "Alt", "⌥", or "Alt Gr" plus the number 2?
On a Spanish layout on macOS, @ is normally produced with Option (⌥) + 2, not with Control + 2, so I want to make sure we are talking about the same keys. A photo of the key you press would be perfect if it is easy to take.
6. Open Settings → Profiles → Keys → General for the profile you use, and tell me what is selected for Left Option key and Right Option key (Normal, Esc+, or Meta). If either one is set to anything other than Normal, please try setting both to Normal, restart iTerm2, and check whether @ and } work again. That alone may explain the symptom.
7. Do you have a ~/Library/KeyBindings/DefaultKeyBinding.dict file? Run this in Terminal (the macOS one, not iTerm2):
ls -l ~/Library/KeyBindings/DefaultKeyBinding.dict
7. If it exists, please attach it. macOS uses this file to remap keys at the Cocoa level, and a stray entry there can cause a key to beep and move the cursor instead of inserting a character.
Once I have the debug log and the plist I should be able to tell you exactly what is happening and how to fix it.