--- gedit/gedit/gedit-file.c	2004-07-06 11:01:53.000000000 +0530
+++ gedit-new/gedit/gedit-file.c	2004-07-06 11:01:00.000000000 +0530
@@ -876,18 +876,17 @@ gedit_file_open_single_uri (const gchar*
 gboolean
 gedit_file_open_from_stdin (GeditMDIChild *active_child)
 {
-	struct stat stats;
 	gboolean ret = TRUE;
 	GeditDocument *doc = NULL;
 	GError *error = NULL;
 	GeditMDIChild *child;
 	GeditMDIChild* new_child = NULL;
+	gchar *stdin_str = NULL;
 
 	gedit_debug (DEBUG_FILE, "");
 	
-	fstat (STDIN_FILENO, &stats);
-	
-	if (stats.st_size  == 0)
+	stdin_str = gedit_utils_get_stdin ();
+	if (stdin_str == NULL || strlen (stdin_str) <= 0)
 		return FALSE;
 
 	child = active_child;
@@ -910,7 +909,8 @@ gedit_file_open_from_stdin (GeditMDIChil
 	doc = child->document;
 	g_return_val_if_fail (doc != NULL, FALSE);
 
-	ret = gedit_document_load_from_stdin (doc, &error);
+	ret = gedit_document_load_from_stdin (doc, stdin_str, &error);
+	g_free (stdin_str);
 
 	if (error)
 	{
--- gedit/gedit//gedit-document.h	2004-07-06 11:02:14.000000000 +0530
+++ gedit-new/gedit/gedit-document.h	2004-07-06 11:01:19.000000000 +0530
@@ -131,6 +131,7 @@ void		gedit_document_load 		(GeditDocume
 						 const GeditEncoding  *encoding);
 
 gboolean	gedit_document_load_from_stdin 	(GeditDocument        *doc, 
+						 gchar                *stdin_str,
 						 GError              **error);
 
 gboolean 	gedit_document_is_untouched 	(const GeditDocument *doc);
--- gedit/gedit/gedit-document.c	2004-07-06 11:02:31.000000000 +0530
+++ gedit-new/gedit/gedit-document.c	2004-07-06 11:01:34.000000000 +0530
@@ -1264,7 +1264,8 @@ gedit_document_load (GeditDocument      
 }
 
 gboolean
-gedit_document_load_from_stdin (GeditDocument* doc, GError **error)
+gedit_document_load_from_stdin (GeditDocument* doc, gchar *stdin_str,
+				GError **error)
 {
 	gchar *stdin_data;
 	GtkTextIter iter, end;
@@ -1273,7 +1274,7 @@ gedit_document_load_from_stdin (GeditDoc
 
 	g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), FALSE);
 	
-	stdin_data = gedit_utils_get_stdin ();
+	stdin_data = strdup (stdin_str);
 
 	if (stdin_data != NULL && strlen (stdin_data) > 0)
 	{
--- gedit/gedit/ChangeLog	2004-07-10 15:10:49.000000000 +0530
+++ gedit-new/gedit/ChangeLog	2004-07-10 15:14:15.000000000 +0530
@@ -1,3 +1,11 @@
+2004-07-10  Muktha  <muktha.narayan@wipro.com>
+
+	* gedit-file.c (gedit_file_open_from_stdin):
+	* gedit-document.h (gedit_document_load_from_stdi):
+	* gedit-document.c (gedit_document_load_from_stdin):
+	Fix the problem of gedit not displaying the piped command output 
+	from terminal. Bug #147256.
+
 2004-06-26  Muktha  <muktha.narayan@wipro.com>
 
 	* dialogs/gedit-page-setup-dialog.c (dialog_response_handler):
