Me vs Backspace: my war against a rogue character
TweetAmazingly, this is my second story about me and a single character.
A while ago, I began receiving reports from various people in IRC that I was prepending a garbage ascii character to some of my messages. I found this very odd. The complaints didn’t stop. It became a running joke. Eventually, playful mockery. It is a bit demeaning to hang out in programmer corners and not have any idea how, what, or why your computer is misbehaving.
After a bit of digging, I discovered that the rogue in question was the character for backspace. Now, this is an odd character to be inserted into text because most often this character doesn’t actually go anywhere, it informs the program that you want to, you know, backspace. This story gets a bit tricky here because not only does this character rarely make it into text, but most programs won’t render it. Only certain programs, on certain platforms, will actually render the backspace character as anything (usually a box with a little 0×0008, or as ^H). So while other people were telling me about rogue characters, I never saw them.
My first suspicion was that the IRC program I was using, Colloquy, was bugged (spoiler alert: it’s not). I spent a long time asking colloquy/irc people, searching the googles, and otherwise trying to figure out how this rogue character was getting printed. I continued to fail. I continued to be mocked.
The plot thickens…
One day I recieved an instant message from my brother: “What is that weird character at the beginning of your messages?”. Wait? What? My instant messages have the same character? Surely Adium isn’t suffering from the same bug, is it? How have I not heard of this before?
It turns out that most instant messaging programs don’t render the backspace character. Pidgin, however, does. And that day my brother was using Pidgin, and he saw the character of doom. I eventually noticed that I was apparently inserting rogue character using Safari, and later Firefox, all on my work computer (a Mac). It’s important to note that none of my Mac programs — Chrome, Safari, Firefox, Adium, or Colloquy — would render the character, but they were all inserting it at the beginning of lines into random things. (You could see the character if you viewed my text using Firefox on windows or linux, for example).
I decided to wipe my Mac, reinstall the OS, and see if that fixed it. It didn’t. I began to suspect this was a hardware problem having to do with my Mac. I spent a long time asking mac people, searching the googles, and otherwise trying to figure out how this rogue character was getting printed. I continued to fail. I continued to be mocked.
Luckily, my Mac was breaking anyway…
After this went on for close to a year, my Mac began having all kinds of problems including its charging circuitry, so I decided to replace my mac (or rather, lobby to have my work replace my mac). I bought a bright shiny new macbook pro and was good to go. I was pretty sure this would solve the problem.
Very soon thereafter, before I setup my new computer, I went to my Hacker News profile and saw this message: http://news.ycombinator.com/item?id=1531448 A user by the name of ‘davidw’ informed me that the stupid character appeared in a comment I wrote. There’s only one problem: I wrote that message using my wife’s mac. (if my life was a tv show, this is where the screen would go black — end of episode).
So I get my new computer setup, and ask the people in IRC if the character was still happening. It was! Gahh!!! This was good news, and bad news. It finally meant that I’ve reproduced this problem on three different macbooks in a variety of programs. It had to be something I was doing that was causing this.
I spent the next half-hour in IRC, talking to myself, trying to reproduce the problem. I finally figured it out.
TLDR: It’s a Mac bug (I think)
You can see the nasty character, live, in this comment: http://news.ycombinator.com/item?id=1530832. For many of you, however, this comment will look completely normal. That is because the program you are using doesn’t render it. If you, for example, use firefox in linux, you will see the rogue character. I’ve got a screenshot for you:

Here’s how to reproduce the problem, exactly: On a mac laptop (and maybe others), you need to hold down LEFT SHIFT and an arrow key (LEFT ARROW works great). While holding those two buttons, press backspace (or, to be precise, DELETE). The tricky part, however, is verifying that you’ve actually sent a rogue character, since none of the standard mac programs (that I know of) will render the character. The way that I verified the problem was to use Colloquy to send IRC messages to myself, reading those messages using emacs-irc. There are other ways, I am sure.
Why I kept doing it: I often use the shift-<arrow> shortcut to highlight various bits of text. Most often I tend to do shift-UP to highlight an entire line and then hit DELETE to remove it. Obviously, if I do this incorrectly, it ends up replacing the entire line with the backspace character. As I type in the new line, it comes out as a perpended backspace character on my final submission.
The million dollar question: is this a bug, or is there some feature I’m inadvertantly using? Anyone got any bright ideas on how I could fix this (other than unlearning my shift-UP habits)?
Tweet
twitter
July 22nd, 2010 at 3:11 pm
On Windows, I often use CTRL+Backspace to remove a word instead of a character. If I do this in certain fields, such as the Windows XP logon prompt password field or in Notepad.exe, it will add the backspace character instead of removing a few characters.
I think you stumbled upon a feature, with the unfortunate side effect of not being able to see the character.
I often use Command+A then backspace to clear what I’ve written when on OS X. If you can change your muscle memory you will probably not have any issues with that combination.
July 22nd, 2010 at 4:07 pm
Here’s an easy way to test it in OS X: fire up TextEdit and make a new and hold Shift + Left and hit Delete a few times. Save the file and open up Terminal.app, and find your file, and run hexdump on it. You should the backspaces.
July 22nd, 2010 at 5:07 pm
ctrl+shift+a to select the line before the cursor.
(see also: http://www.applematters.com/article/emacs-commands-work-in-os-x-how-awesome-is-that/ )
i tend to use option + backspace to delete whole words.
July 22nd, 2010 at 6:02 pm
I was breaking my school’s e-learning system by printing invisible characters that broke their XML-based storage
July 23rd, 2010 at 1:34 am
Are you using an external keyboard? If so, maybe something like http://doublecommand.sourceforge.net/ will help in mapping the keyboard keystrokes to what the mac is expecting. I use it to map my MS keyboard to the apple keyboard characters. Without it, what I type is messed up, and the backspace/delete doesn’t work at all (on my keyboard setup, anyway).
If you aren’t using an external keyboard, then, well, if you’re highlighting text to remove it, you don’t technically need to hit the delete key to remove it. Could you just start typing? Yeah, that’s part of the “Do I need to relearn how I type?” issue I think you’re trying to avoid.
July 23rd, 2010 at 2:52 am
I tried it myself, and I’ve found that it also happens with Escape and Control-A, -B, etc. instead of Delete.
July 24th, 2010 at 1:59 am
It certainly is a WYSIWYG failure. A program transmitting extraneous characters whilst hiding this fact from the end user should indeed be qualified as buggy.
July 27th, 2010 at 1:39 am
Just remembering that back in the Paleozoic when I was developing funky bespoke terminal emulators for a living, for several years one of them used codes in the lower 31 to embed format/presentation information (toggle underline/bold/reverse, move to X/y position, etc) in their proprietary protocol. ISTR ASCII 08 would toggle background color (light/dark); useful for showing redactions. So, in effect, if some of your messages ended up on this (still widely used) information system and were displayed “correctly,” all text would be redacted (hidden) until the beginning of the next “real” redaction (so that only the *redacted* text would display) or the terminal (hardware/software) were reset.
Ah, the days when developers blindly trusted incoming data…. wait a minute; isn’t that the Web?
August 2nd, 2010 at 7:33 pm
Try Ukelele http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=ukelele
Maybe you will notice your keyboard layout has something wrong mapped with shift+delete, that actually renders as “insert a delete character” instead of “just delete”.
That said, I’d actually point my finger directly at OSX or its APIs.
August 6th, 2010 at 10:31 pm
This is not a Mac bug.
I’ve just reproduced it on Linux.
What I did:
In a new OpenOffice Writer document, I typed in three letters, then deleted two of them with your method (Left Shift, Left Arrow, Backspace). I saved this document as .htm and opened it in Firefox. And guess what. It was full of this funny character, the un-removed letter, and of course the usual OOWriter formatting clutter.
When I opened this .htm in Google Chrome, the character was gone… It was just like opening
http://news.ycombinator.com/item?id=1530832
in Firefox vs. in Chrome…
September 16th, 2010 at 11:06 pm
I think the left shift is a red herring. I think what is happening is the SHIFT+Backspace is set to actually insert the backspace character.
March 15th, 2011 at 6:21 am
Wow!! Someone has the same problem! I wonder how my source code still compiles, does gcc ignore this character too?
Also, without an arrow key, it does not insert a backspace. Did you also file a bug with Apple?
July 12th, 2011 at 4:18 pm
It is very a pity to me, that I can help nothing to you. I hope, to you here will
help. Do not despair.
February 7th, 2012 at 8:23 am
Apart from saving time there are no apparent benefits of jogging over walking. But to maximize the effects you can try various speed variations in walking.
places to stay hervey baypijnbestrijding
February 9th, 2012 at 4:39 am
Buy a ticket for bus-second time made no mistake to travel by train and tightened their luggage for a holiday.
климатици
February 21st, 2012 at 9:37 am
The boy stopped abruptly and bike frames but had not wept for joy that he felt solid ground under my feet. влагоуловители
February 22nd, 2012 at 10:03 am
In the past it was so easy, he thought Drain. отпушване на канали
February 27th, 2012 at 6:18 am
To obtain a qualitative frame it must withstand the following weather conditions without damage suffered. интериорни врати
March 1st, 2012 at 1:40 am
Brought together for a US TV series in 1966, Jones, Micky Dolenz, Michael Nesmith and Peter Tork hits included Daydream Believer and I’m a Believer.
Jones was married three times and had four daughters.
The Monkees’ TV show was popular in both the US and the UK, and the band had four number one albums in a 13-month period.
They were famous for their clean-cut image and were marketed as the American answer to The Beatles, notching up nine top 40 hits.
March 5th, 2012 at 8:09 am
After the expiry of the mandate of both members and the President, they can be renewed. Collegiality European Court of Auditors decide by majority vote of its members. Its headquarters is in Luxembourg. Димитър Веселинов Калинов
March 8th, 2012 at 3:25 am
Rationally organized system of federal government garantiraoptimalno distribution of powers between central and local authorities retain identity and national characteristics of the individual participating countries. електротехник
March 9th, 2012 at 3:04 am
Unlike the ACP countries and overseas territories can use, however, means a number of EU programs that are designed for the member states. електро услуги
March 12th, 2012 at 3:45 am
They are perennial, with a relatively constant source of nourishment – snow melting and rains during the summer monsoon. дърводелски услуги
March 13th, 2012 at 8:52 am
These are: production of alcoholic beverages, tobacco and tobacco products, electronic, and air defense equipment, production of explosive materials and weapons, production of chemicals and drugs.
смяна на щрангове
March 14th, 2012 at 7:37 am
Each year there are about 2 million infected, of whom about 1 million visokoinfektsiozni. Statistics show that every minute in India dies, suffering from tuberculosis. вик ремонти
March 20th, 2012 at 9:40 am
Gujarat is the largest producer of tobacco and cotton in the country and provides tolyama part of the raw materials of textiles and soap industry. The state gives a large amount of raw materials for paper industry. бойлер
March 28th, 2012 at 5:59 am
But if absolute demographic growth does not slow down, this indicator can acquire negative trends. мобилни климатици
April 17th, 2012 at 8:59 am
Hat-construction “zahlupva” space underneath and protects very well from κλιματιστικά sun and rain.
May 16th, 2012 at 7:22 am
Introduction of maple way of inclusion of electricity in the rooms, зареждане на автоклиматици the location of panic buttons and other relevant
дограма safety instructions.