At some point in the last 24 hours my return key has stopped behaving properly in Xcode. For example, in the console if I type in:
po someObject
And then hit the return key, previously this would run the command. Now, it just enters a newline. If I hit function-return though, it runs the command as expected.
I get the same sort of behaviour in the Find pane.
I don’t believe I’ve made any recent updates to either Xcode or OS X.
Any ideas what I might have done?
The first place to look would be
Preferences>Key Bindings, paying special attention to theCustomizedtab, and see if anything looks amiss there. Looking it over, I don’t see any binding that looks directly like “execute console command”, but it’s a long list. You can also see what return is currently bound to by picking an unset command and attempting to set it to return, at which point the conflicts will be shown in the status bar.With the default settings, it appears that return is bound to “Insert Newline” while fn+return is bound to “Insert Newline without Extra Action” which sounds a lot like the opposite behavior of what you’re seeing: you get no extra action by default, and the usual effect with the function modifier. (I’m impressed that you thought to even try that key combo.)
Given that, have a look at
System Preferences>Keyboardand make sure that “Use all F1, F2, etc. keys as standard function keys” is unchecked. That has the effect of reversing the need for the fn modifier key for the function keys, so it might well affect return also (which doesn’t usually make a difference, but XCode apparently distinguishes). I’m not sure how that would have been set accidentally, but who knows.Finally, assuming that this is just some weird oddity of XCode, you can always try the classic Mac app trick of blowing away the preferences file:
~/Library/Preferences/com.apple.XCode.plistto somewhere else like your desktop.Obviously you’ll lose any preferences you’ve set, but hopefully there aren’t so many that it’s a hassle to re-set them. (For the bold, you could also try diff’ing the plist files and track down the problem setting that way.)