While using nano to edit a file on my Ubuntu 24.04.1 test server, nano will sometimes freeze after a paste. The server is headless, and communication is via secure shell from a MS Windows 11 computer via OpenSSH_for_Windows_9.5p1. I have to close the terminal session in windows and start again, often loosing the edits done prior to the freeze.
I have tried every keystroke I can think of to try to get the session unfrozen, but so far nothing has worked.
As far as I can determine the nano task seems to still be running. In the below example, there are 2 nano session running, one is frozen and one is not:
doug@s19:~$ ps -eo tid,class,ni,pri,psr,pcpu,stat,wchan:14,comm | grep -e nano -e bash
644876 TS 0 19 1 0.0 Ss do_wait bash
644888 TS 0 19 2 0.0 S+ wait_woken nano
644938 TS 0 19 6 0.0 Ss do_wait bash
647126 TS 0 19 11 0.0 Ss do_wait bash
675011 TS 0 19 1 0.0 S+ wait_woken nano
How do I know the problem is on the Ubuntu side? I don’t, and am pursuing the issue from the windows side also. Regardless, if there is some way to “kick” things out from being frozen it would very useful.
Note 1: PuTTY 0.83 was installed and tried as the SSH client, and the issue did not occur. I prefer the windows SSH client over PuTTY.
Note 2: I think, but am not certain, the issue occurs when numbers are copied and pasted into nano session. I do not know how to reliably create the issue, but I do have a simplified file where it always occurs:
and:
EDIT: putting that same file onto a raspberry pi, via rsync and then using nano (version 3.2) there worked fine.
EDIT: putting that same file onto a Debian server, via rsync and then using nano (version 5.4) there worked fine. CORRECTION: FAILS
The version on my 24.04 server is 7.2
EDIT: putting that same file onto a Ubuntu 24.10 VM running on the Debian server, via rsync and then using nano (version 8.1) there worked fine. Note that while trying to paste “10000” it actually pasted “10000~”.
EDIT: putting that same file onto a Ubuntu 24.04.2 VM running on the Debian server, via rsync and then using nano (version 7.2) there failed.
EDIT: I installed the nano 8.3-1 package from launchpad. It still has the “10000~” instead of “10000” issue, but at least it doesn’t freeze.
I believe there are 2 issues here: First, Either windows or windows SSH puts extra characters into the clipboard buffer or inserts them during paste; Second, some versions of nano don’t deal well with those characters.
Link to this same issue on Win32-OpenSSH-GitHub page