diff --git a/src/libraries/utils/filepath.ml b/src/libraries/utils/filepath.ml
index 08bf976d26bcf00241e3187ef77d7ca4b809d618..bb81becc638c5148cf947d41834722d426133f07 100644
--- a/src/libraries/utils/filepath.ml
+++ b/src/libraries/utils/filepath.ml
@@ -233,14 +233,7 @@ let pretty file_name =
     skip_dot file_name
   else
     let path = insert cwd file_name in
-    let file_name = path.path_name in
-    let cwd_name = cwd.path_name in
-    if String.starts_with ~prefix:cwd_name file_name && cwd_name <> file_name
-    then
-      let n = 1 + String.length cwd_name in
-      String.sub file_name n (String.length file_name - n)
-    else
-      skip_dot (add_path path)
+    skip_dot (add_path path)
 
 (* -------------------------------------------------------------------------- *)
 (* --- Relative Paths                                                     --- *)
diff --git a/tests/misc/share_directory.t/run.t b/tests/misc/share_directory.t/run.t
index c95421570d344b6252a44ef5869b0e01f481ac3d..0792a43ff37bf2ff403d092a69a1b6f135ad3178 100644
--- a/tests/misc/share_directory.t/run.t
+++ b/tests/misc/share_directory.t/run.t
@@ -4,21 +4,21 @@ Basic case
   $ dune exec -- frama-c
   [kernel] IS_SET false
   [dirs] path (dir)
-  [dirs] Found: _build/install/default/share/frama-c/share/dirs/path
+  [dirs] Found: FRAMAC_SHARE/dirs/path
   [dirs] Path (.)
-  [dirs] Found: _build/install/default/share/frama-c/share/dirs/path
+  [dirs] Found: FRAMAC_SHARE/dirs/path
   [dirs] path/file.txt (file)
-  [dirs] Found: _build/install/default/share/frama-c/share/dirs/path/file.txt
+  [dirs] Found: FRAMAC_SHARE/dirs/path/file.txt
   [dirs] Path (file)
-  [dirs] Found: _build/install/default/share/frama-c/share/dirs/path/file.txt
+  [dirs] Found: FRAMAC_SHARE/dirs/path/file.txt
   [dirs] foo (dir)
   [dirs] User Error: Could not find directory foo in Frama-C/directories share
   [dirs] foo.txt (file)
   [dirs] User Error: Could not find file foo.txt in Frama-C/directories share
   [dirs] path (file)
-  [dirs] User Error: _build/install/default/share/frama-c/share/dirs/path is expected to be a file
+  [dirs] User Error: FRAMAC_SHARE/dirs/path is expected to be a file
   [dirs] path/file.txt
-  [dirs] User Error: _build/install/default/share/frama-c/share/dirs/path/file.txt is expected to be a directory
+  [dirs] User Error: FRAMAC_SHARE/dirs/path/file.txt is expected to be a directory
 
 With option
   $ cp -r share copied