[haiku-bugs] [Haiku] #18029: Pasting into nano etc. eats newlines and indentation

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Tue, 01 Nov 2022 07:23:21 -0000

#18029: Pasting into nano etc. eats newlines and indentation
-----------------------------------+-----------------------------
 Reporter:  humdinger              |       Owner:  jackburton
     Type:  bug                    |      Status:  new
 Priority:  normal                 |   Milestone:  Unscheduled
Component:  Applications/Terminal  |     Version:  R1/Development
 Keywords:                         |  Blocked By:
 Blocking:                         |    Platform:  All
-----------------------------------+-----------------------------
 This is hrev56563.

 If I copy&paste something from a GUI editor like StyledEdit into an editor
 runnning in Terminal, like nano or ne, the newlines (CR? LF?) and tabs
 don't make it. For nano, the width of the Terminal window seems to
 determine where a line ends most times, it appears.

 This block:

 {{{
 # Get optional 'action'
 options="clean debug catkeys help h -h --h --help"
 for item in $options ; do
         for opt in "$@" ; do
                 if [ "$opt" = "$item" ] ; then
                         action="$opt"
                         break
                 fi
         done
 done
 }}}

 becomes pasted in nano:

 {{{
 # Get optional 'action'
 options="clean debug catkeys help h -h --h --help" for item in $options ;
 do for opt in "$@"
         ; do
                 if [ "$opt" = "$item" ] ; then action="$opt" break fi done
 done
 }}}

 "ne", the 'nice editor' seems to interpret the first CR/LF(?) as some sort
 of command or something (not a big user of "ne" yet...), and jumps into a
 sort of input line at the bottom.

 I did a quick check, it works as expected under linux.

 [Not sure about the category for this ticket...]
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/18029>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: