Windows and running nano text editor in admin console

As you may know I use a Mac for all my development. So Windows gets little attention.

This probably doesn't affect too many people. But I've discovered a very annoying issue with Windows when trying to run the "nano" text editor in the Kiwi admin console. Windows of course likes to use control characters as shortcuts (close window, quit application, cut/paste, etc).

On the Mac this is all done with command characters (equivalent to using the Windows key). This leaves control characters free and that allows the Linux terminal+shell use of control characters, as seen by the admin console window, to not be interfered with by the os and browser. Nano primarily uses control characters (with some meta secondary characters -- see nano help page) so this works well.

With windows this mostly works too because the browser allows control characters to be intercepted by Javascript and not passed onto the os. With one huge exception: control-w (close window/tab). Unfortunately control-w is nano's "search forward" key. And if you have any sort of muscle memory with nano you're going to find yourself repeatedly unintentionally closing the browser when using Windows.

I have discovered a workaround however:

  • Use the alternate search forward key: f6 (i.e. fn-f6). Or use "search backwards" control-q possibly followed by a "repeat search forward" (meta-w) if there are multiple search matches.
  • Because you're not going to always remember the above here's how you can prevent control-w from closing the tab on Firefox: Make the Kiwi admin connection a Firefox "pinned tab". Do this by right-clicking on a tab containing a regular admin connection. Now click "pin tab". The tab will now transform into a small icon on the left side of the tab toolbar. These "pins" are automatically opened (but not initially selected) when Firefox is started. But most importantly, when they are selected, a control-w does not close the pin. Now you still have to use f6 as mentioned above to get a nano search-forward. But at least you won't be unintentionally closing the browser window all the time.

Control-w is also the shell's "backspace word" key. An alternative is esc followed by control-h

Sign In or Register to comment.