bugGNU nano - Bugs: bug #66892, tabs in an external paste at a...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #66892: tabs in an external paste at a prompt are not preserved

Submitter:  Benno Schulenberg <bens>
Submitted:  Tue 11 Mar 2025 03:05:09 PM UTC
   
 
Severity:  2 - Minor Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Jump to the original submission

Thu 03 Apr 2025 10:46:34 AM UTC, comment #6: 

The fix was released in nano-8.4.

Benno Schulenberg <bens>
Group administrator
Fri 14 Mar 2025 09:58:15 AM UTC, comment #5: 

Fixed in git, commit bf39ffe9, by treating ^I specially as a permitted character in a paste at a prompt.

Benno Schulenberg <bens>
Group administrator
Thu 13 Mar 2025 06:48:05 PM UTC, comment #4: 

comment #3:

> Copy/pasting within nano (with M-6/^U) of course copies the text faithfully: tabs stay tabs.  But when using the mouse to copy, the terminal does the copying, and as nano displays only spaces on the screen (converting tabs to the appropriate number of spaces), in the subsequent paste you will get only spaces.  Nano does not make use of the tabstops that a terminal might provide, as the user might have changed where the tabstops are.
>

Thanks for the explanation.

Doug Smythies <dougsmythies>
Thu 13 Mar 2025 04:08:02 PM UTC, comment #3: 

Copy/pasting within nano (with M-6/^U) of course copies the text faithfully: tabs stay tabs.  But when using the mouse to copy, the terminal does the copying, and as nano displays only spaces on the screen (converting tabs to the appropriate number of spaces), in the subsequent paste you will get only spaces.  Nano does not make use of the tabstops that a terminal might provide, as the user might have changed where the tabstops are.

Benno Schulenberg <bens>
Group administrator
Wed 12 Mar 2025 06:06:49 PM UTC, comment #2: 

I was referred to this bug report from another one.

I agree that pasting into the prompt should at lease keep some form of the blank space.

If one copies a string from inside nano and then pastes it isn't the tab character converted to a space character, and so that is why it pastes properly? It is the same while editing a file, a paste from some external source, keeps the tab characters, while a copy and paste from within the file results in tabs converted to spaces. I do not know if that is a nano thing or something else. I am using a windows computer to communicate via SSH (WIN-SSH or PuTTY, it doesn't matter for this) with my ubuntu 24.04.2 server computer.

I have not tried the patch yet.

Doug Smythies <dougsmythies>
Tue 11 Mar 2025 03:22:17 PM UTC, comment #1: 

Proposed patch is attached.

(file #56999)

Benno Schulenberg <bens>
Group administrator
Tue 11 Mar 2025 03:05:09 PM UTC, original submission:  

To reproduce, copy "this string" (wich contains a tab character between the two words) and paste it at the Search prompt.  See that "thisstring" is the result.

The expected result is: "this string".  Because when cutting or copying the same string from a buffer inside nano and pasting it at a prompt with ^U, the tab character is preserved just fine.

(Problem exists since before version 2.2.0.)

Benno Schulenberg <bens>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dougsmythies (Posted a comment)
  • -email is unavailable- added by bens (Submitted the item)
  •  

    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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-04-03 bens Open/ClosedOpen Closed
    2025-03-14 bens StatusNone Fixed
    2025-03-11 bens Attached File- Added preserve-tab-in-external-paste.patch, #56999

    Back to the top

    Powered by Savane 3.15.
    Corresponding source code