diff -ur coreutils-8.27.orig/src/ls.c coreutils-8.27/src/ls.c
--- coreutils-8.27.orig/src/ls.c	2017-01-21 15:53:43.000000000 +0100
+++ coreutils-8.27/src/ls.c	2017-04-12 00:49:07.508203339 +0200
@@ -200,6 +200,9 @@
     /* For symbolic link, name of the file linked to, otherwise zero.  */
     char *linkname;
 
+    /* For OSC 8 hyperlinks. */
+    char *really_absolute_name;
+
     struct stat stat;
 
     enum filetype filetype;
@@ -248,11 +251,12 @@
                           struct quoting_options const *options,
                           int needs_general_quoting,
                           const struct bin_str *color,
-                          bool allow_pad, struct obstack *stack);
+                          bool allow_pad, struct obstack *stack,
+                          char const *really_absolute_name);
 static size_t quote_name_buf (char **inbuf, size_t bufsize, char *name,
                               struct quoting_options const *options,
                               int needs_general_quoting, size_t *width,
-                              bool *pad);
+                              bool *pad, char const *really_absolute_name);
 static char *make_link_name (char const *name, char const *linkname);
 static int decode_switches (int argc, char **argv);
 static bool file_ignored (char const *name);
@@ -346,6 +350,8 @@
 
 static bool color_symlink_as_referent;
 
+static char hostname[HOST_NAME_MAX + 1];
+
 /* mode of appropriate file for colorization */
 #define FILE_OR_LINK_MODE(File) \
     ((color_symlink_as_referent && (File)->linkok) \
@@ -548,6 +554,8 @@
 
 static bool print_with_color;
 
+static bool print_hyperlink;
+
 /* Whether we used any colors in the output so far.  If so, we will
    need to restore the default color later.  If not, we will need to
    call prep_non_filename_text before using color for the first time. */
@@ -814,6 +822,7 @@
   FULL_TIME_OPTION,
   GROUP_DIRECTORIES_FIRST_OPTION,
   HIDE_OPTION,
+  HYPERLINK_OPTION,
   INDICATOR_STYLE_OPTION,
   QUOTING_STYLE_OPTION,
   SHOW_CONTROL_CHARS_OPTION,
@@ -864,6 +873,7 @@
   {"time", required_argument, NULL, TIME_OPTION},
   {"time-style", required_argument, NULL, TIME_STYLE_OPTION},
   {"color", optional_argument, NULL, COLOR_OPTION},
+  {"hyperlink", optional_argument, NULL, HYPERLINK_OPTION},
   {"block-size", required_argument, NULL, BLOCK_SIZE_OPTION},
   {"context", no_argument, 0, 'Z'},
   {"author", no_argument, NULL, AUTHOR_OPTION},
@@ -1503,6 +1513,9 @@
       obstack_init (&subdired_obstack);
     }
 
+  if (print_hyperlink)
+    gethostname(hostname, HOST_NAME_MAX + 1);
+
   cwd_n_alloc = 100;
   cwd_file = xnmalloc (cwd_n_alloc, sizeof *cwd_file);
   cwd_n_used = 0;
@@ -1786,6 +1799,7 @@
             format = (isatty (STDOUT_FILENO) ? many_per_line : one_per_line);
           print_block_size = false;	/* disable -s */
           print_with_color = false;	/* disable --color */
+          print_hyperlink = false;	/* disable --hyperlink */
           break;
 
         case FILE_TYPE_INDICATOR_OPTION: /* --file-type */
@@ -2008,6 +2022,22 @@
             break;
           }
 
+        case HYPERLINK_OPTION:
+          {
+            int i;
+            if (optarg)
+              i = XARGMATCH ("--hyperlink", optarg, color_args, color_types);
+            else
+              /* Using --hyperlink with no argument is equivalent to using
+                 --hyperlink=always.  */
+              i = color_always;
+
+            print_hyperlink = (i == color_always
+                               || (i == color_if_tty
+                                   && isatty (STDOUT_FILENO)));
+            break;
+          }
+
         case INDICATOR_STYLE_OPTION:
           indicator_style = XARGMATCH ("--indicator-style", optarg,
                                        indicator_style_args,
@@ -2720,7 +2750,7 @@
       DIRED_INDENT ();
 
       quote_name (realname ? realname : name, dirname_quoting_options, -1,
-                  NULL, true, &subdired_obstack);
+                  NULL, true, &subdired_obstack, NULL /* FIXME actual value?? */);
 
       DIRED_FPUTS_LITERAL (":\n", stdout);
     }
@@ -3078,6 +3108,7 @@
     }
 
   if (command_line_arg
+      || print_hyperlink
       || format_needs_stat
       /* When coloring a directory (we may know the type from
          direct.d_type), we have to stat it in order to indicate
@@ -3128,6 +3159,11 @@
           attach (absolute_name, dirname, name);
         }
 
+      if (print_hyperlink)
+        {
+          f->really_absolute_name = realpath(absolute_name, NULL);
+        }
+
       switch (dereference)
         {
         case DEREF_ALWAYS:
@@ -4166,7 +4202,8 @@
 static size_t
 quote_name_buf (char **inbuf, size_t bufsize, char *name,
                 struct quoting_options const *options,
-                int needs_general_quoting, size_t *width, bool *pad)
+                int needs_general_quoting, size_t *width, bool *pad,
+                char const *really_absolute_name)
 {
   char *buf = *inbuf;
   size_t displayed_width IF_LINT ( = 0);
@@ -4357,7 +4394,7 @@
 
 static size_t
 quote_name_width (const char *name, struct quoting_options const *options,
-                  int needs_general_quoting)
+                  int needs_general_quoting, const char *really_absolute_name)
 {
   char smallbuf[BUFSIZ];
   char *buf = smallbuf;
@@ -4365,7 +4402,7 @@
   bool pad;
 
   quote_name_buf (&buf, sizeof smallbuf, (char *) name, options,
-                  needs_general_quoting, &width, &pad);
+                  needs_general_quoting, &width, &pad, really_absolute_name);
 
   if (buf != smallbuf && buf != name)
     free (buf);
@@ -4375,10 +4412,26 @@
   return width;
 }
 
+static char *
+uriescape (const unsigned char *str)
+{
+  char *esc = xmalloc(3 * strlen(str) + 1);
+  char *p = esc;
+  while (*str)
+    {
+      if (*str >= 32 && *str <= 126)
+        *p++ = *str++;
+      else
+        p += sprintf(p, "%%%02x", (unsigned int) (*str++));
+    }
+  *p = '\0';
+  return esc;
+}
+
 static size_t
 quote_name (char const *name, struct quoting_options const *options,
             int needs_general_quoting, const struct bin_str *color,
-            bool allow_pad, struct obstack *stack)
+            bool allow_pad, struct obstack *stack, char const *really_absolute_name)
 {
   char smallbuf[BUFSIZ];
   char *buf = smallbuf;
@@ -4386,7 +4439,7 @@
   bool pad;
 
   len = quote_name_buf (&buf, sizeof smallbuf, (char *) name, options,
-                        needs_general_quoting, NULL, &pad);
+                        needs_general_quoting, NULL, &pad, really_absolute_name);
 
   if (pad && allow_pad)
       DIRED_PUTCHAR (' ');
@@ -4397,8 +4450,20 @@
   if (stack)
     PUSH_CURRENT_DIRED_POS (stack);
 
+  if (really_absolute_name)
+    {
+      char *h = uriescape (hostname);
+      char *n = uriescape (really_absolute_name);
+      printf ("\e]8;;file://%s%s\a", h, n);
+      free (h);
+      free (n);
+    }
+
   fwrite (buf, 1, len, stdout);
 
+  if (really_absolute_name)
+    printf ("\e]8;;\a");
+
   if (buf != smallbuf && buf != name)
     free (buf);
 
@@ -4425,7 +4490,7 @@
                                && (color || is_colored (C_NORM)));
 
   size_t len = quote_name (name, filename_quoting_options, f->quoted,
-                           color, !symlink_target, stack);
+                           color, !symlink_target, stack, f->really_absolute_name);
 
   process_signals ();
   if (used_color_this_time)
@@ -4705,7 +4770,7 @@
   if (print_scontext)
     len += 1 + (format == with_commas ? strlen (f->scontext) : scontext_width);
 
-  len += quote_name_width (f->name, filename_quoting_options, f->quoted);
+  len += quote_name_width (f->name, filename_quoting_options, f->quoted, f->really_absolute_name);
 
   if (indicator_style != none)
     {
@@ -5072,6 +5137,9 @@
                                (overridden by -a or -A)\n\
 "), stdout);
       fputs (_("\
+      --hyperlink[=WHEN]     hyperlinkify (always/auto/never)\n\
+"), stdout);
+      fputs (_("\
       --indicator-style=WORD  append indicator with style WORD to entry names:\
 \n\
                                none (default), slash (-p),\n\
