5 ms·
Me vs Backspace: my war against a rogue character
- hackermom 16y agoI do all the shift+arrow text marking with my right hand solely, incl. cmd+backspace (delete) - and so, I never run into the problem of accidentally inserting the $08 character anywhere. But, yes, you are right, holding shift+any arrow key, while hitting backspace, inserts a $08 by the OS X IME. This does depend on what kind of dialog you are writing in (NSTextField, NSTextInput etc.), however, as not all of them accepts this input. You can't input a backspace character this way in Terminal.app, f.e.
- bradleyland 16y agoInteresting. In my text editor (TextMate), I can reproduce this pretty reliably using that key sequence.
- bradleyland 16y agoVideo: http://www.youtube.com/watch?v=wLMNin-2p6A http://www.youtube.com/watch?v=wLMNin-2p6A
- snprbob86 16y agoThis would be a good time to point out that OSX supports Emacs bindings in all Cocoa text fields. For example, you can press ctrl+a to go to the beginning of the line and ctrl+e to go to the end of the line. The "Meta" modifier can be accessed via alt+ctrl, so you can alt+ctrl+f to go forward a word, or alt+ctrl+b to go back a word. Any motion can be combined with shift to select the text. These are especially useful with the laptop keyboards. Bonus points if you convert your caps lock key into an additional ctrl key: http://mkaz.com/archives/86/disable-caps-lock-on-mac-os-x/ http://mkaz.com/archives/86/disable-caps-lock-on-mac-os-x/
- lanstein 16y agoalternatively, for Terminal, set -o vi I also bind H to ^ and L to $ with bind -m vi 'H: vi-first-print' bind -m vi 'L: end-of-line' (not OS X specific, but related)
- thought_alarm 16y agoJacob Rus has an excellent and thorough write up of the Cocoa Text system: http://www.hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System.html http://www.hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System.... He provides a custom DefaultKeyBinding.dict which adds more emacs keybindings to Cocoa text controls. I've been using it for years: http://www.hcs.harvard.edu/~jrus/Site/KeyBindings/Emacs%20Esc%20Bindings.dict http://www.hcs.harvard.edu/~jrus/Site/KeyBindings/Emacs%20Es...
- kragen 16y agoUnfortunately it's missing the most crucial Emacs bindings: C-s and C-r.
- woodall 16y agoHere is another article I found on this, "Mac Delete Key Bug Demonstration". http://gunther.web66.com/crossjava/Bugs/deletekeybug/ http://gunther.web66.com/crossjava/Bugs/deletekeybug/
- bradleyland 16y agoThat's a different bug and is only relevant for Java apps. On a Mac, the backspace key is labeled "delete", and the key associated with the action most people refer to as "delete" is labeled with the delete special character[1]. Apple refers to this as the "forward delete" key. The bug described at the link you provided does not require the shift or arrow keys to be pressed and produces a different control character. 1 - http://en.wikipedia.org/wiki/Delete_key http://en.wikipedia.org/wiki/Delete_key
- deleted 16y ago[deleted]
- thought_alarm 16y agoFun historical note: The original Mac keyboard had a Backspace key rather than a Delete key. http://www.vectronicsappleworld.com/collection/articlepics/512ke/snap21.jpg http://www.vectronicsappleworld.com/collection/articlepics/5... The current Mac "Delete" key was inherited from the Apple IIgs ADB keyboard, and it stuck around.
- TrevorBramble 16y agoReminds me of finding out the hard way that "paste" is bound to Mouse3 by default in Gnome and that on some mice I'll occasionally scroll the wheel violently enough to trigger clicks. Took a few times of finding random text in my code to realize what was happening, and even longer to figure out how.
- jmillikin 16y agoThis isn't Gnome, it's X11 -- if you select text with the mouse and then middle-click, it'll paste whatever you selected. Luckily, the X11 clipboard is separate from the Gnome clipboard, so Ctrl-C/Ctrl-V continue to work properly after selecting something. I haven't figured out how to disable the X11 clipboard yet. If you find a way, please post it ;)
- randallsquared 16y ago"Luckily". That's not how I'd put it. :) I really like using the X11 clipboard, and the fact that copying and pasting is inconsistent (it seems like some applications have their own, third clipboard!) is very frustrating under X11. Of course, the behavior of selecting everything when you single click in a field (like a web browser URL bar) destroys this functionality, too.
- almost 16y agoI really really hate when that happens. It was driving me mad with Emacs for a while until I added this to my .emacs: (setq x-select-enable-clipboard t) (if (functionp 'x-cut-buffer-or-selection-value) (setq interprogram-paste-function 'x-cut-buffer-or-selection-value))
- moe 16y agovery frustrating under X11 Personally I find it amusing this "feature" has survived all this time, all the way into modern linux desktops. Inertia is a powerful beast indeed. I understand the reluctance to throw out such decisions, even if they were made over 20(!) years ago, because inevitably the vocal minority will jump out of the woodwork and declare how they can not possibly live on without this feature. However at some point common sense has to take precedence in UI design. Otherwise you end up with a trainwr^W^Wthe linux desktop.
- fleitz 16y agoI've verified this issue using TextEdit saving the file and printing it using "od -a". I've also submitted it to bugreport.apple.com as bug # 8223684
- frossie 16y agoI decided to wipe my Mac, reinstall the OS, and see if that fixed it. So reinstalling the whole OS was higher up the troubleshooting chain than just trying it out from your wife's computer? Err...
- jerf 16y agoPiffle. Sure you can make that criticism after he told you the answer. Could you have told him before? If you've never done the equivalent, it's only because you haven't been around computers very long.
- frossie 16y agoIf you've never done the equivalent, it's only because you haven't been around computers very long. Dude, in twenty years with computers I have never re-installed an OS to fix a problem (obviously this is distinct from installing a new version of the OS which could legitimately have a fix for it). For me rebooting the computer is even a last act of desperation that I am ashamed to take. But then I am a unix/Linux user. I grant you the possibility that this may somehow have been a rational act for MacOS, though if true I find that disappointing.
- lbrandy 16y agoSo reinstalling the whole OS was higher up the troubleshooting chain than just trying it out from your wife's computer? Err.. I think you are suggesting a non-causal solution. What exactly is this "it" you think I should have tired on my wife's computer? The character never appears in my normal mac usage. So despite the fact that I use her computer all the time, I never noticed it happening (though I'm sure it did) from her computer.
- thaumaturgy 16y agoYep. You encountered a totally insidious, elusive bug. Even if you had tried it from your wife's computer, it probably wouldn't've shown up then. At the time, all you had to go on was that there was a probable misconfiguration somewhere in the deep, dark innards of MacOS, and the best way to handle that particular problem is to nuke it from orbit.
- foopooper 16y agoNegroes are scary!