Special characters are not showing up by holding down a key
I used to be able to hold down a key to get special characters -- e.g., accented characters for vowels. Now all I get is the same letter repeating. I have tried using the command "defaults write -g ApplePressAndHoldEnabled -bool true" in Terminal but it does not work. When I reboot the functionality reappears but it would be nice not needing to reboot every time this functionality stops working. It happens quite frequently.
MacBook Pro (2021)