swcarpentry / windows-installer

Software Carpentry installer for Windows.
MIT License
21 stars 17 forks source link

nano cursor movement not working in Windows default console #55

Open iamc opened 8 years ago

iamc commented 8 years ago

Using Git for Windows 2.9.0 installed selecting "Use Windows' default console window" nano launches correctly but when trying to move the cursor using the keyboard arrow keys it complains with a [ Unknown Command ] message, and the cursor does not move.

nano

This was a known problem when using MinTTY terminal and launching nano with winpty nano https://github.com/swcarpentry/windows-installer/issues/31#issuecomment-133718108 in order to avoid the redirection is not supported error with MinTTY https://github.com/swcarpentry/windows-installer/issues/50, but for me it happens the same in the default windows console.

You can circumvent this running nano doing

start nano

which opens up nano in a new window, where the arrow keys work properly.

Or you can use

^f
^b 
^n
^p 

but in my opinion this adds up too much cognitive load to shell newcomers.

embray commented 8 years ago

I'm of a mind to drop nano on Windows entirely and use notepad.

iamc commented 8 years ago

I like the fact or running the editor in the same console you are working and not spanning more windows.

For my next workshop I'll consider moving to MobaXterm. I know it's not free as in freedom, but the free version is quite good, and we do use eg. GitHub for the git lessons, so...

I also noticed that it has a package manager for Cygwin packages, so the stack installation would be trivial. Somethign as "open a MobaXterm terminal an type"

apt-cyg install nano git gitk

Although perhaps we have to take care of Anaconda paths.

embray commented 8 years ago

You do have a point there. New learners have a hard time as it is groking the relationship between command-line programs and GUI programs (something I wish the shell lesson focused more on, over contrived wildcard patterns).

FWIW apt-cyg can be added easily to any standard Cygwin install. But there's also MSYS2 with pacman.

embray commented 8 years ago

(I would die without apt-cyg--Cygwin seems almost useless without it anymore)

embray commented 8 years ago

I spent a little time on this today, but I can't for the life of me find a solution. nanorc doesn't allow rebinding commands to arbitrary keyboard controls, so I can't get it to bind the "move left" "move right" etc. commands to control codes that are actually being sent when I press "left" "right", etc.

talamus commented 4 years ago

This would be very useful now that Windows has the official OpenSSH support. It would be nice to log in to a Windows Server via ssh and edit some files with nano.

ElSrJuez commented 4 years ago

+1 Old IT pro, relatively new to linux, love nano. Windows Server Core would benefit handsomely if nano wokred over SSH?

YvesR commented 4 years ago

+1 Old IT pro, relatively new to linux, love nano. Windows Server Core would benefit handsomely if nano wokred over SSH?

Same issue here. Started worked with Windows Server Core and use OpenSSH as it works nice now. But with need of an editor and already use nano on mac and linux I loved to use nano here as well. So I installed using choco install nano but sadly found out that cursor movement do not work properly here (Using Terminal from Mac in a ssh session).

Any ideas?

artisticcheese commented 2 years ago

Use Micro instead of nano (choco install micro), no issues with cursors, syntax highlighting etc. Nano = 6 years, no solution

image