Created attachment 1699460 [details] screenshot nano --linenumbers is only partially useful when you select whole lines and the line numbers are part of the selection too
I am not able to reproduce the bug. Which build of nano are you using? Does it happen with the default configuration?
nano is running with defaults and no config file on the machine, just started with --linenumbers /etc/nanorc is untouched [root@srv-rhsoft:~]$ rpm -q konsole5 konsole5-19.12.1-1.fc31.x86_64 [harry@srv-rhsoft:~]$ rpm -q nano nano-4.3-3.fc31.x86_64 [harry@srv-rhsoft:~]$ which nano alias nano='/usr/bin/nano --linenumbers' /usr/bin/nano [root@srv-rhsoft:~]$ cat /etc/nanorc | grep -P -v "^#" | sort | uniq include "/usr/share/nano/*.nanorc" set speller "hunspell" [root@srv-rhsoft:~]$
OK, got it. I think you forgot to say that you had selected the text by mouse. So it was the terminal what captured any text regardless of its meaning within nano. If you want the mouse events to be handled by nano, you need to enable the mouse support explicitly: either via the --mouse command-line option, or the `set mouse` configuration directive. But even in that case it does not seem to work as you expect, as mouse just seems to move the cursor within nano's edit buffer.
well, --mouse would solve this problem by making selection completly impossible, so you can't have the line numbers in the selection :-) i would love to still select some text with the mose and paste it with a middle click elsewhere in the file but without the need to remove the line numbers manually
(In reply to Harald Reindl from comment #4) > well, --mouse would solve this problem by making selection completly > impossible, so you can't have the line numbers in the selection :-) It is not impossible. Try to click somewhere, then initiate text selection by keyboard, and then click somewhere else. > i would love to still select some text with the mose and paste it with a > middle click elsewhere in the file but without the need to remove the line > numbers manually I am afraid that there is no such feature in nano. You can try a different editor (for example vim supports this after `set mouse=a`) or try to implement it yourself in nano.
anyways, it's not really sane that the line numbers are part of the selection in 2020
Sorry if I was unclear. The line numbers are not part of the editor's selection. They are part of the terminal's selection. This way you can for example include the menu bar into the selection, etc. I understand that it is not what you want in this specific case. On the other hand it is not a useless feature in general.