gedit does not read from a pipe

Bug #9054 reported by Arnold Maestre
164
This bug affects 29 people
Affects Status Importance Assigned to Milestone
gedit
Fix Released
Wishlist
gedit (Fedora)
Won't Fix
Low
gedit (Ubuntu)
Fix Released
Low
Ubuntu Desktop Bugs

Bug Description

The GNOME text editor, gedit, has a cool and documented feature (by documented I
mean they tell about it in the man page) which allows it to read input from a
pipe. For example 'ls -lR | gedit' allows one to open a new buffer in gedit and
populate it with the output of 'ls -lR'. This does not seem to work in Ubuntu,
and thus breaks some of my working habits. Would it be possible to enable this
feature in future releases ?

http://bugzilla.gnome.org/show_bug.cgi?id=121891: http://bugzilla.gnome.org/show_bug.cgi?id=121891

Revision history for this message
Arnold Maestre (maestre) wrote :

Some additional information about the problem. It seems to be dependant on the
colors used by the shell. When I do

ls -l | gedit

gedit opens with an empty buffer. But if I do

ls -l | cat | gedit

gedit opens a buffer filled with the output of ls -l, as expected. Can this
filtering step be avoided ?

Revision history for this message
Matt Zimmerman (mdz) wrote :

Neither of those pipelines work for me

Revision history for this message
Arnold Maestre (maestre) wrote :

(In reply to comment #2)
> Neither of those pipelines work for me

I'm using plain old warty, and the second pipeline worked when I posted it. Now
it fails miserably.

Can something updated in between have broken it ?

Revision history for this message
Sebastien Bacher (seb128) wrote :

I've opened a bug upstream about this:
http://bugzilla.gnome.org/show_bug.cgi?id=160255

Revision history for this message
Daniel Robitaille (robitaille) wrote :

Corrected upstream bug report which contains the first draft of a patch that
apparently solves the problem::
http://bugzilla.gnome.org/show_bug.cgi?id=121891

Revision history for this message
Phil Bull (philbull) wrote :

This still seems to be an issue, gedit 2.14.0-0ubuntu1 (latest Dapper). Can anyone else confirm this?

Revision history for this message
Arnold Maestre (maestre) wrote :

Absolutely, "ls|gedit" still fails (opens an empty document), even when ls is called without the usual alias wich translates to "ls --color=auto".

Phil Bull (philbull)
Changed in gedit:
status: Unconfirmed → Confirmed
Changed in gedit:
status: Confirmed → In Progress
Revision history for this message
geh (geh) wrote :

Indeed, it fails (= opens an empty document) under gnome-terminal and rxvt. My version is 2.14.2 , I'm using Dapper.

Changed in gedit:
assignee: seb128 → desktop-bugs
Revision history for this message
Josh Bowman (bowmanjj) wrote :

+1 here... I'm using Edgy, with:

- gnome-terminal 2.16.1
- bash 3.1.17(1)
- gedit 2.16.1

All of the following open an empty doc:

ls | gedit
ls -l | gedit
ls | cat | gedit
ls -l | cat | gedit

Revision history for this message
hdante (hdante) wrote :

It doesn't work here (Edgy), I tried
diff -bla bla bla | gedit

Revision history for this message
Phil Bull (philbull) wrote :

Still doesn't work in Feisty.

Revision history for this message
Stephen Crosby (stevecrozz) wrote :

Doesn't work in gutsy either.

Changed in gedit:
status: Confirmed → Triaged
Revision history for this message
Andrew Mathenge (mathenge) wrote :

when I type:

ls -l | gedit

I get the following errors first:

(gedit:8745): atk-bridge-WARNING **: AT_SPI_REGISTRY was not started at session startup.

(gedit:8745): atk-bridge-WARNING **: IOR not set.

(gedit:8745): atk-bridge-WARNING **: Could not locate registry

Then gedit opens with an empty buffer.

Revision history for this message
Victor Mendonça (victorbrca) wrote :

I also have the same problem on my Ubuntu Gutsy install

2.6.22-14-generic

Revision history for this message
Bart Cramer (bart-cramer) wrote :

Same thing here. Tried: "ls -l | gedit" on latest gutsy.

Revision history for this message
Igor Katson (descentspb) wrote :

you can do it like this:

ls -l > - | gedit -

Revision history for this message
Polaris (arnold-maestre) wrote : Re: [Bug 9054] Re: gedit does not read from a pipe

On Feb 12, 2008 3:44 PM, descent <email address hidden> wrote:

> you can do it like this:
>
> ls -l > - | gedit -

Yes, but in this case this works because "-" is a physical file. So you end
up with a file named "-" in the folder (and probably in the 'ls -l' output,
too), which could be disturbing for some users (especially since 'rm -'
doesn't work, you have to issue 'rm "-"').

You can actually do this properly, like: ls -l >/tmp/dummy | gedit
/tmp/dummy (or /dev/shm/dummy, if available), but reading from a pipe would
be far nicer.
--
Arnold

Revision history for this message
Michael Rooney (mrooney) wrote :

Hello, I would just like to add that this also affects Hardy.

Also I appreciate the workaround Igor, but it is unwieldy and assumes you have write access to the working directory, which is not always going to be the case.

The upstream bug report seems somewhat stagnant; a patch or two is provided but from what I gather they are too old to be applicable to the current codebase.

Revision history for this message
Michael Rooney (mrooney) wrote :

Any reason this is 'Wishlist' if the documentation explicitly mentions piping as a feature (Gedit Manual / Programming Features):

    "You can use gedit to pipe the output of a command to a text file. For example, to pipe the output of an ls command to a text file, type ls | gedit, then press Return. The output of the ls command is displayed in a new text file in the gedit window."

It seems like either this bug shouldn't be wishlist (I assume Low instead), or there should be another bug to the effect of "gedit documentation says it can read from pipes although it can't"

Revision history for this message
Pedro Villavicencio (pedro) wrote :

marking it as low then.

Changed in gedit:
importance: Wishlist → Low
Revision history for this message
Richard Wooding (m-launchpad-richardwooding-com) wrote :

This does not work on hardy either tried

ls -l | gedit
ls -l | cat | gedit

both render an empty document.

This would be a killer feature.

Revision history for this message
Kernel (hybrid-kernel) wrote :

A 2004 bug is still not fixed? This was driving me mad as I read that gedit can read from pipe, only to find this bug. It should be fixed in Intrepid at the very latest.

I'd always tried
dmesg | gedit
dpkg -l | gedit
(etc...)

Revision history for this message
Pedro Villavicencio (pedro) wrote :

Supersonicdarky, the bug is a low priority one and there's also a couple of patches upstream that need to be tested and probably need some more work and you're welcome to try any of those options but just complaining is not going to solve anything, moreover it only create noise in the bug mail, so please if you want to comment on such bugs do it in the right way and not just complaining, thanks in advance.

Changed in gedit:
status: In Progress → Confirmed
Revision history for this message
In , FeRD (ferd-redhat-bugs) wrote :

Description of problem:

The GNOME (yelp) documentation for GEdit states, in the section "Features / Piping the Output of a Command to a File":

----------
You can use gedit to pipe the output of a command to a text file. For example, to pipe the output of an ls command to a text file, type ls | gedit, then press Return.

The output of the ls command is displayed in a new text file in the gedit window.
----------

That functionality does not currently work in gedit 2.24.3 on either of my installed Fedora 10 systems (i386, x86_64). Near as I can tell, it hasn't worked anytime recently.

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

2.24.3-3.fc10.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. run "ls | gedit"
2.
3.

Actual results:
Empty "Unsaved Document 1"

Expected results:
"Unsaved Document 1" (or another title?) containing the output of the 'ls' command

Additional info:

Either the stdin-to-new-document functionality should be fixed, or the documentation should be adjusted to omit description of this nonfeature.

Revision history for this message
In , FeRD (ferd-redhat-bugs) wrote :

This has apparently been living in GNOME's bugzilla since 2003 (GNOME 2.2.x), and on 2009-01-01 it was morphed into an enhancement request by Paolo Borelli (<email address hidden>), a GEdit developer. That seems to imply it's not a simple fix; I don't know why they don't just remove the feature from the documentation.

External bug reference added.

Revision history for this message
Luka Marčetić (paxcode) wrote :

Still doesn't work! (gedit 2.26.1 on Debian squeeze)
5 years anniversary closing!!!

Revision history for this message
TuteC (tutecosta) wrote :

Neither work for me also:

ls -l | gedit
ls -l | cat | gedit

gedit 2.26.1 on Ubuntu 9.04

Revision history for this message
TuteC (tutecosta) wrote :

Neither work for me:

ls -l | gedit
ls -l | cat | gedit

gedit 2.26.1 on Ubuntu 9.04

Revision history for this message
Pedro Villavicencio (pedro) wrote :

The bug was sent upstream and it's confirmed there as well, there's no need to re-re-re-re- confirm the issue with comments here, there's a nice button on the top of this reports that says "affects me too" please press that and subscribe to the report, commenting only generates bug noise, if you want this to be fixed then provide a patch. Thanks.

Revision history for this message
TuteC (tutecosta) wrote :

I love you too, sorry for the inconveniences.
Sometimes we are needed to recieve RTFMs to learn.
Thank you anyway.

On Fri, Aug 21, 2009 at 3:12 PM, Pedro Villavicencio<email address hidden> wrote:
> The bug was sent upstream and it's confirmed there as well, there's no
> need to re-re-re-re- confirm the issue with comments here, there's a
> nice button on the top of this reports that says "affects me too" please
> press that and subscribe to the report, commenting only generates bug
> noise, if you want this to be fixed then provide a patch. Thanks.
>
> --
> gedit does not read from a pipe
> https://bugs.launchpad.net/bugs/9054
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in gedit - Light-Weight Text Editor for Gnome: Confirmed
> Status in “gedit” package in Ubuntu: Triaged
>
> Bug description:
> The GNOME text editor, gedit, has a cool and documented feature (by documented I
> mean they tell about it in the man page) which allows it to read input from a
> pipe. For example 'ls -lR | gedit' allows one to open a new buffer in gedit and
> populate it with the output of 'ls -lR'.  This does not seem to work in Ubuntu,
> and thus breaks some of my working habits. Would it be possible to enable this
> feature in future releases ?
>
> http://bugzilla.gnome.org/show_bug.cgi?id=121891: http://bugzilla.gnome.org/show_bug.cgi?id=121891
>

Revision history for this message
In , Bug (bug-redhat-bugs) wrote :

This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 10 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora please change the 'version' of this
bug to the applicable version. If you are unable to change the version,
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Revision history for this message
In , FeRD (ferd-redhat-bugs) wrote :

(non)Feature is still documented; still nonexistent.

Revision history for this message
Gabe Gorelick (gabegorelick) wrote :

The man page included in Karmic for gedit 2.28.0 removes the reference to gedit being able to read from a pipe, so I think this bug should become a wishlist one again.

Revision history for this message
Jc (kenny-au-ski) wrote :

On the Sun terminal I have at work, it works perfectly. I copy-paste the
information about the platform in case it is useful.

Operating System: SunOS Release 5.10 Generic_142900-02
Desktop: CDE 5.10, X11 Version 6.6.2

Revision history for this message
Gabe Gorelick (gabegorelick) wrote :

@Jc Really? Thats, weird. Maybe it somehow got implemented when Sun ported gnome to Solaris.

Revision history for this message
Gabe Gorelick (gabegorelick) wrote :

Just an update, references to reading from a pipe is no longer in the gedit man page as of Karmic, but it still is in the yelp docs.

Revision history for this message
In , Bug (bug-redhat-bugs) wrote :

This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle.
Changing version to '13'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Changed in gedit:
status: Confirmed → Fix Released
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

This is fixed upstream now

Changed in gedit (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
In , FeRD (ferd-redhat-bugs) wrote :

Over in the Gnome bug tracking this issue, Jesse van den Kieboom reports that the feature to create a new buffer from stdin (read from pipe) has been implemented. The code is in the gedit development tree, and will appear in the next major release.

Jesse's update to Gnome bug #121891:
https://bugzilla.gnome.org/show_bug.cgi?id=121891#c32

Revision history for this message
beej (beej) wrote :

Polaris:
you wrote "You can actually do this properly, like: ls -l >/tmp/dummy | gedit
/tmp/dummy (or /dev/shm/dummy, if available), but reading from a pipe would
be far nicer." i believe you meant "ls -l > /tmp/dummy && gedit /tmp/dummy", yes?

Revision history for this message
In , Ray (ray-redhat-bugs) wrote :

Excellent. Thank you for tracking this. That work will roll into Fedora at some point in the near future, so I'm going to close this report out.

Changed in gedit:
importance: Unknown → Wishlist
Revision history for this message
Akshay S Dinesh (asdofindia) wrote :

i dunno if this's the solution. but "grep -l pattern * | xargs gedit" seems to be working xargs

Revision history for this message
Stas Sușcov (sushkov) wrote :

When do we get this in natty?

geira (geira)
Changed in gedit (Ubuntu):
status: Fix Committed → Fix Released
Changed in gedit (Fedora):
importance: Unknown → Low
status: Unknown → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.