Today I learned how to fix an issue with Ctrl+left and Ctrl+right not working in the new Python REPL on MacOS.
The (new) Python REPL (3.13+) has many useful keyboard shortcuts and two of them are Ctrl+left and Ctrl+right, which are used to navigate the cursor by skipping to the beginning/end of words, as the GIT below shows:
On MacOS, the keybindings were not working at all. With the help of the new REPL trace functionality, we found out they weren't even making it to Python!
After lots of digging, we found out what the issue was: MacOS was hijacking the two keybindings Ctrl+left and Ctrl+right for spaces-related shortcuts. To turn those off, go to Settings > Keyboard Shortcuts > Mission Control > Mission Control dropdown > Untick “Move left a space” and “Move right a space”.
+35 chapters. +400 pages. Hundreds of examples. Over 30,000 readers!
My book “Pydon'ts” teaches you how to write elegant, expressive, and Pythonic code, to help you become a better developer. >>> Download it here 🐍🚀.