News for hackers. Stuff that matters.
Re:micro – A Modern Alternative to nano by rob74 on Friday August 18, 2023 @10:06AM (#37175786)
The difference between micro and nano is that nano's keyboard shortcuts are pretty opinionated, while micro's are the ones used by most (GUI) applications nowadays: Ctrl+S for saving, Ctrl+F for find, Ctrl+Z for undo, Ctrl+Q to exit etc. etc. There is also a helpful hint at the bottom of the screen that you can press Alt+G to see the shortcuts, or Ctrl+G for some help.
Re:micro – A Modern Alternative to nano by mdaniel on Friday August 18, 2023 @11:01AM (#37176629)
> Ctrl-S for saving ... Ctrl+Q to exit

Using a flow control sequences for editor commands; what can go wrong?

Re:micro – A Modern Alternative to nano by rollcat on Friday August 18, 2023 @11:35AM (#37177066)
It conveniently translates to "save and exit"!

Hopefully a cautionary tale against careless in-band signalling.

Re:micro – A Modern Alternative to nano by mardifoufs on Friday August 18, 2023 @04:40PM (#37181797)
Wait I don't understand the issue. What are you referring to?
Re:micro – A Modern Alternative to nano by kip_ on Friday August 18, 2023 @05:28PM (#37182375)
Some of us graybeards use to use teletypes to talk to our computers. In one of the earlier races between differing I/O, the printer couldn't print as fast as the teletype was receiving data, so the teletype would send XOFF (Ctrl-S) to tell the remote end "Stop sending data and let me catch up" and would then send XON (Ctrl-Q) to say "I'm caught up, go back to sending data.

Many of us carried that to our VT100 terminals and used it when lines of code or output would flood the screen faster than we could read.

Eventually paginators like 'more' and 'less' were invented and flow control via the keyboard codes for XON/XOFF fell out of favor, but some of us have very strong muscle memory. :)

Re:micro – A Modern Alternative to nano by mdaniel on Friday August 18, 2023 @09:10PM (#37184368)
A fine answer, but my life experience is that it's not just "muscle memory," I am showing that xon and xoff still work inside both Terminal.app and iTerm2 (echo $TERM shows "xterm-256color") so maybe there's some legacy stuff configured in them or something, but I'm just saying that I struggle to think of who the audience is that would be running micro but not via a virtual terminal library that implements flow control
Re:micro – A Modern Alternative to nano by mdaniel on Friday August 18, 2023 @09:12PM (#37184377)
While I was double checking my memory about ctrl-s and ctrl-q, this link came up in my search results which may interest you, also: https://retrocomputing.stackexchange.com/questions/7263/hist...
Re:micro – A Modern Alternative to nano by musicale on Friday August 18, 2023 @09:06PM (#37184334)
I imagine avoiding control key sequences is part of the reason why Apple added the apple/command key to their keyboards. Makes it easy to copy text in a terminal emulator, etc.!

Whenever I use Windows my fingers are surprised to remember that the windows key isn't used for menu commands.

Re:micro – A Modern Alternative to nano by gilcot on Saturday August 19, 2023 @02:23PM (#37191595)
I've been told that IBM and Microsoft though that sending application commands with dedicated key sequences wouldn't be useful. Function keys should suffice (so I think Midnight/Total Commander interfaces are the right one to expect) but later IBM came with CUDA…
Re:micro – A Modern Alternative to nano by tivert on Friday August 18, 2023 @11:35AM (#37177073)
> The difference between micro and nano is that nano's keyboard shortcuts are pretty opinionated, while micro's are the ones used by most (GUI) applications nowadays:

Opinionated, or just old and consistent? Nano is a clone of an editor related in 1989. Things weren't as settled back then. IIRC, I remember Ctrl-X was used to exit some DOS apps. IIRC, the current "GUI conventions" originated as Mac-isms in 1983/84.

> Ctrl+S for saving, Ctrl+F for find, Ctrl+Z for undo, Ctrl+Q to exit etc. etc. There is also a helpful hint at the bottom of the screen that you can press Alt+G to see the shortcuts, or Ctrl+G for some help.

So, about that Ctrl-C...

Re:micro – A Modern Alternative to nano by codedokode on Friday August 18, 2023 @12:06PM (#37177647)
> Opinionated, or just old and consistent?

That old hotkeys didn't survive the evolution so it doesn't make sense to support them anymore.

Re:micro – A Modern Alternative to nano by tivert on Friday August 18, 2023 @01:35PM (#37179219)
> That old hotkeys didn't survive the evolution so it doesn't make sense to support them anymore.

No. It makes sense to support them if the userbase is familiar with them. Nothing is more annoying than having changes like that forced on you.

Then there's the fact that the "GUI standards" conflict with other command-line standards in a pretty serious way. Every command shell on Windows I've ever used uses a different convention than the "GUI standard" for copy-paste for exactly that reason (e.g. Windows Command Prompt's "mark" stuff, PuTTY's select/middle-click behavior).

Re:micro – A Modern Alternative to nano by GoblinSlayer on Friday August 18, 2023 @01:58PM (#37179572)
Won't such hardcore oldtimers use vi anyway? I thought the point of nano was to be like notepad.
Re:micro – A Modern Alternative to nano by cesarb on Friday August 18, 2023 @02:20PM (#37179912)
> I thought the point of nano was to be like notepad.

No, the point of nano was to be like pico.

Re:micro – A Modern Alternative to nano by codedokode on Friday August 18, 2023 @02:48PM (#37180327)
> userbase is familiar

I think that every user who can use terminal, knows combinations like Ctrl + S (Save) or Ctrl + C (Copy). So they are familiar to them as well and should cause no problems.

For me, for example, those combinations from vi, nano or emacs are simply weird and non-standard. And I assume that they are "non-standard" for everyone who was born after 1980 and have never seen a PDP or something from that era.

Therefore it doen't make sense to support those key combinations only because 40 years ago they were used in PDP and other archaic systems.

Re:micro – A Modern Alternative to nano by tivert on Saturday August 19, 2023 @02:07AM (#37186031)
> Therefore it doen't make sense to support those key combinations only because 40 years ago they were used in PDP and other archaic systems.

OK, you write the memo about replacing Ctrl-C for SIGINT.

Re:micro – A Modern Alternative to nano by MagicMoonlight on Friday August 18, 2023 @05:54PM (#37182666)
Lmao what userbase, you're talking about software from 40 years ago
Re:micro – A Modern Alternative to nano by Shared404 on Friday August 18, 2023 @07:06PM (#37183284)
For nano?

Every single Linux user who edits text on a cli amd hasn't bothered to learn vim.

Re:micro – A Modern Alternative to nano by nurettin on Saturday August 19, 2023 @01:01AM (#37185678)
Every person who deployed code or edited configuration files without a graphical user interface knows about nano.
Re:micro – A Modern Alternative to nano by Kwpolska on Saturday August 19, 2023 @04:04AM (#37186608)
How many of those people are attached to nano's key combos?
Re:micro – A Modern Alternative to nano by dotnet00 on Saturday August 19, 2023 @10:16AM (#37189024)
Probably a decent chunk of them, due to having them committed to muscle memory.
Re:micro – A Modern Alternative to nano by lostmsu on Tuesday August 22, 2023 @10:22AM (#37223137)
As one of them I would guess less than 10% of users
Re:micro – A Modern Alternative to nano by stonetrw on Friday August 18, 2023 @06:15PM (#37182860)
Yes, it's time inferior gui apps start freezing when you press C-z.
Re:micro – A Modern Alternative to nano by oso2k on Saturday August 19, 2023 @04:37PM (#37192907)
Correct. I’ve used pico & nano as my primary editors for 25+ years. A fun one to work around with nano in shellinabox browser tab is ctl+w (Where is/“Find” function in nano/pico, Close tab in Chrome/Firefox). nano let’s you remap it to ctl+f in nanorc at least.
Re:micro – A Modern Alternative to nano by tpoacher on Tuesday August 22, 2023 @02:35PM (#37226833)
Aside from the fact that all shortcuts are completely and easily remappable, Nano's default shortcuts actually make a LOT of sense once you start using them.

I find myself thinking I'm in nano mode and wanting to repeat searches forward and backward outside of nano so often, that when I realise I need to do something other than Alt-W/Alt-Q I have a mini-depressive episode.