556d3c0
--- mc-4.6.1-pre5/src/main.c.userhost	2005-07-08 11:04:37.718907992 +0200
556d3c0
+++ mc-4.6.1-pre5/src/main.c	2005-07-08 11:07:53.888085744 +0200
556d3c0
@@ -33,6 +33,7 @@
556d3c0
 #   include <unistd.h>
556d3c0
 #endif
e52ead9
 
556d3c0
+#include <pwd.h>
556d3c0
 #include <errno.h>
556d3c0
 #include <ctype.h>
556d3c0
 #include <signal.h>
556d3c0
@@ -1607,9 +1608,22 @@ void
e52ead9
 update_xterm_title_path (void)
e52ead9
 {
556d3c0
     unsigned char *p, *s;
e52ead9
+    char h[64];
e52ead9
+    struct passwd *pw;
e52ead9
 
e52ead9
     if (xterm_flag && xterm_title) {
e52ead9
 	p = s = g_strdup (strip_home_and_password (current_panel->cwd));
65f3b0e
+        if ( !gethostname (h, 64) ) {
65f3b0e
+                h[63] = '\0'; /* Be sure the hostname is NUL terminated */
65f3b0e
+                s = g_strdup_printf ("%s:%s", h, s);
65f3b0e
+                g_free (p);
65f3b0e
+                p = s;
65f3b0e
+        }
65f3b0e
+        if ( (pw = getpwuid(getuid())) ) {
65f3b0e
+                s = g_strdup_printf ("%s@%s", pw->pw_name, s);
65f3b0e
+                g_free (p);
65f3b0e
+                p = s;
65f3b0e
+        }
e52ead9
 	do {
65f3b0e
 #ifndef UTF8
556d3c0
 	    if (!is_printable (*s))