Bug 70512 - Pasting doesn't seem to work in pico
Pasting doesn't seem to work in pico
Product: Red Hat Public Beta
Classification: Retired
Component: vte (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Havoc Pennington
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2002-08-01 18:26 EDT by Marc Deslauriers
Modified: 2007-04-18 12:45 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-08-14 03:17:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Screenshot of pico before pasting text into it (104.05 KB, image/png)
2002-08-04 23:14 EDT, Marc Deslauriers
no flags Details
Screenshot of pico after pasting a few lines from gedit into it (101.96 KB, image/png)
2002-08-04 23:15 EDT, Marc Deslauriers
no flags Details

  None (edit)
Description Marc Deslauriers 2002-08-01 18:26:26 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020724

Description of problem:
When using pico in a gnome terminal, if you cut some multi-line text from a
gnome application and paste it in pico, it comes out all crooked. I think this
is a pico bug as paste seems to work fine in vi.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Open a test file in gedit, select a few lines and "copy" them
2.Open a text file in pico, under a gnome terminal and "paste"

Actual Results:  The pasted lines seem to be mixed up with the text already in pico

Expected Results:  Paste should work in pico.

Additional info:

Pasting works with a text file in vi, so I'm not inclined to think it's a
gnome-terminal bug...
Comment 1 Mike A. Harris 2002-08-04 13:41:14 EDT
Please attach a screenshot of this corruption.
Comment 2 Marc Deslauriers 2002-08-04 23:14:59 EDT
Created attachment 68846 [details]
Screenshot of pico before pasting text into it
Comment 3 Marc Deslauriers 2002-08-04 23:15:43 EDT
Created attachment 68847 [details]
Screenshot of pico after pasting a few lines from gedit into it
Comment 4 Marc Deslauriers 2002-08-04 23:19:18 EDT
I've posted a couple of screenshots to illustrate what is happening. The first
screenshot has pico in gnome-terminal open with a text file. The cursor position
is at the beginning of line 6.

The second screenshot has a three line selection in gedit that was copied using
Edit/Copy from the menu. After, a Edit/Paste was done in the gnome-terminal
window. This resulted in what we see in the screenshot. In other words, I can't
copy from gedit and paste into pico running in gnome-terminal.

Comment 5 chappa 2002-08-09 19:00:55 EDT
The problem is a cooperation between Pico and gedit. From what I see, Pico is
receiving a CTRL-J command. This command comes probably from the input, that
is to say from gedit. What I believe it must be happening is that gedit ends
its lines with ^J (Line Feed), and when Pico reads this input, it receives
the character as a command which causes it to justify the text.

Adding a little bit of information on how Pico works. When you paste text
into Pico, what you are doing is creating a continuous input, where each 
character is read, and the corresponding command is executed. For example
when you enter the letter "A", which is not associated to any command, then
the letter "A" will be inserted in the text, but when a control character
is entered, the command associated to that character will be executed. Pico
can not distinguish between you entering the character ^J from the keyboard
or from a cut'n paste operation.

I know you don't want to read this, but the only work aorund that I can think
of is that you don't paste more than one line at the time.
Comment 6 Mike A. Harris 2002-08-09 20:10:12 EDT
That's what seems to be going on.  If other editors work, and they
seem to work fine in my testing, then it must be a bug in how
gedit's cut and paste works.

Reassigning to gedit.
Comment 7 Havoc Pennington 2002-08-09 21:26:32 EDT
There is presumably a spec for what linefeeds are allowed in the various paste
Comment 8 Marc Deslauriers 2002-08-11 11:19:27 EDT
The same problem occurs when copying and pasting from two picos open in two
gnome-terminals. So, it's probably not an isolated gedit bug.

Comment 9 Owen Taylor 2002-08-12 12:00:23 EDT
I'm pretty positive this is a vte bug, though I don't know the full
details. (I've seen this behavior on occasion with other apps.)

As far as cut-and-paste types go:

 STRING and COMPOUND_TEXT are defined to have \n as the only legimate
   line separator
 UTF8_STRING is unclear (the recommendations in the spec are highly broken)
 text/plain is defined to have \r\n as the line separator, but most people
   who have implemented it as a Xdnd drop type haven't paid attention
   to that.

Confused yet?

Luckily, I don't think sorting this out is needed for VTE .. VTE should
just translate any of \n, \r, or \r\n into the same input sequence as
the user hitting the return key.

The standard GTK+ widgets canonicalize to \n for STRING and COMPOUND_TEXT on 
output, but simply pass line separators through verbatim for STRING and
COMPOUND_TEXT on input and UTF8_STRING for both directions.
Comment 10 Owen Taylor 2002-08-12 12:01:05 EDT
(lost nalin on the CC from the last mail ... misguessed who the owner of
the 'vte' package was.)
Comment 11 Nalin Dahyabhai 2002-08-14 03:17:06 EDT
The widget should be converting newlines to carriage-returns on paste now, so
this should be fixed in vte 0.7.1 and later.
Comment 12 Jay Turner 2002-08-16 00:41:32 EDT
This is working pretty well with vte-0.7.4-1.

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