GNU nano - Bugs: bug #49176, pasted text loses some...
You are not allowed to post comments on this tracker with your current authentication level.
bug #49176: pasted text loses some "\n" and "#" on some terminals
Submitter: | None | ||
Submitted: | Sat 24 Sep 2016 05:35:44 PM UTC | ||
Severity: | 3 - Normal | Status: | Works For Me |
Assigned to: | bens | Open/Closed: | Closed |
Jump to the original submission
Fri 05 May 2017 09:35:18 AM UTC, comment #9: |
Benno Schulenberg <bens> |
Fri 05 May 2017 09:27:59 AM UTC, comment #8: See also bug #50879. |
Benno Schulenberg <bens> |
Wed 11 Jan 2017 11:15:47 AM UTC, comment #7: A solution to the problem would to implement 'bracketed paste mode' (see the request in bug #40060). When we know something is a paste and does not come from the keyboard, we could interpret a ^J as a newline instead of Justify command. |
Benno Schulenberg <bens> |
Thu 29 Sep 2016 07:03:53 PM UTC, comment #6: Pressing the Enter key sends the byte "\r" (^M) to the editor, not the byte "\n" (^J). However, it would indeed have been smarter if nano had interpreted a ^J as equivalent to ^M (as vim and others appear to do, to accomodate silly programs that paste a text as if it were a DOS file), but Pico has chosen to use ^J for Justify, and nano follows Pico... so... my hands are tied there. |
Benno Schulenberg <bens> |
Mon 26 Sep 2016 05:40:12 PM UTC, comment #5: Thanks a lot for your answer. With "bind ^J curpos main", it's at least possible to paste text without losing characters.
|
Tony meman <nobody123> |
Sun 25 Sep 2016 05:19:23 PM UTC, comment #4: To disable the annoying ^J behavior, you could add "unbind ^J all" to your .nanorc file. But that would cause a whole series of "Unbound key" warnings when pasting a piece of text. A passable way to avoid this is to instead add "bind ^J curpos main" to your .nanorc. Then each paste that ends with a linebreak will also show the current cursor position on the statusbar. But that would seem like a small price to pay for regaining correct pastes.
|
Benno Schulenberg <bens> |
Sun 25 Sep 2016 11:41:18 AM UTC, comment #3: "If you make your selection carefully so as to end with a linebreak, you should be able to see the message "Can now Unjustify" on the statusbar after the paste. "
|
Tony meman <nobody123> |
Sun 25 Sep 2016 09:03:23 AM UTC, comment #2: To make sure I understand correctly: if you paste those four lines, the last "\n#" is preserved? And if you paste five lines (that is: an additional blank line), also the fourth "\n#" combo is eaten?
|
Benno Schulenberg <bens> |
Sat 24 Sep 2016 06:00:43 PM UTC, comment #1: OP here: Someone with smarTTY has the same problem: https://sysprogs.com/w/forums/topic/smartty-paste-problem-linebreaks-deleted/
|
Tony meman <nobody123> |
Sat 24 Sep 2016 05:35:44 PM UTC, original submission:
When I paste C source code into nano, it will sometimes eat "\n#", or "#", or "\n"
|
Anonymous |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 6 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2017-05-05 | bens | Assigned to | None | bens | |
Open/Closed | Open | Closed | |||
2017-01-11 | bens | Summary | pasted text sometimes loses "\n" and "#" | pasted text loses some "\n" and "#" on some terminals | |
2016-09-29 | bens | Status | None | Works For Me | |
2016-09-25 | bens | Summary | Paste text eats "\n" and "#" | pasted text sometimes loses "\n" and "#" | |
2016-09-24 | None | Attached File | - | Added nano-err.PNG, #38593 |
Powered by Savane 3.13-3230.
Corresponding source code
Oh, forgot to add: to work around your problem (the paste containing \n instead of \r), you could put this in your nanorc:
bind ^J enter main