How to Remedy “Go to Line” on Nano Editor

There are a few annotations that only Unix-likes are fixated on, one of which is ^. It means the Control key on the keyboard. Official Mac keyboards often include the annotation right on the keycaps, so it is never difficult to find. However, there are shortcuts that just won’t work even after the deciphering. For example, “Go to Line” on GNU nano. The Homebrew version of nano editor says the shortcut is ^/, yet it fails to register.

The actual working shortcut is: ^-.

I did some digging into why it was happening in the first place. The short answer was, macOS Terminal simply does not register (or drops) ^/ as a valid key combination. I was able to verify that using cat -v. However, there is another key press that sends the identical control character: ^_. And on macOS, ^- registers as ^_, since it believes the Shift key was not pressed down for _. So on Mac, ^- sends the exact signal the program is expecting from ^/.

I did also look into the historical background of why nano is displaying ^/ as the key combination. There is no clear answer. It is one rabbit hole of threads and blog posts, mostly arguing in favor of keeping history, conventions, and just leaving the good editor alone when it works. Whereas some versions have quietly updated it already. I understand the arguments for keeping it. Ultimately, from a more modern point of view, I couldn’t resist thinking ‘but that is still not what people are pressing on their keyboard’. If you are interested, it’s a good weekend read.