Bug 1852772 - nano --linenumbers: line numbers are copied with multiline select
Summary: nano --linenumbers: line numbers are copied with multiline select
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: nano
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-01 09:31 UTC by Harald Reindl
Modified: 2020-09-17 13:16 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-09-17 13:16:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
screenshot (30.36 KB, image/png)
2020-07-01 09:31 UTC, Harald Reindl
no flags Details

Description Harald Reindl 2020-07-01 09:31:35 UTC
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

Comment 1 Kamil Dudka 2020-07-01 09:50:53 UTC
I am not able to reproduce the bug.  Which build of nano are you using?  Does it happen with the default configuration?

Comment 2 Harald Reindl 2020-07-01 10:00:53 UTC
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:~]$

Comment 3 Kamil Dudka 2020-07-02 16:30:49 UTC
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.

Comment 4 Harald Reindl 2020-07-02 16:33:57 UTC
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

Comment 5 Kamil Dudka 2020-07-02 17:14:02 UTC
(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.

Comment 6 Harald Reindl 2020-07-02 17:17:06 UTC Comment hidden (abuse)
Comment 7 Kamil Dudka 2020-07-02 17:21:37 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.