summaryrefslogtreecommitdiff
path: root/Userland/Shell
diff options
context:
space:
mode:
authorMax Wipfli <mail@maxwipfli.ch>2021-05-29 23:15:54 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-01 09:28:05 +0200
commit628c7f094f78d06d28c9fe0f14968e00e82e5be3 (patch)
tree37f2426b6716282c13f02ee6fa05839d9e30d707 /Userland/Shell
parent5caaa52bee16b4016cfee5ae0a78292c5c0987d5 (diff)
downloadserenity-628c7f094f78d06d28c9fe0f14968e00e82e5be3.zip
LibGUI+Shell+bt+ls: Use proper APIs for creating file URLs
This patch replaces ad-hoc generation of file URL strings with using URL::create_with_file_scheme().
Diffstat (limited to 'Userland/Shell')
-rw-r--r--Userland/Shell/Shell.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp
index f64d4c33d8..94c7efcc66 100644
--- a/Userland/Shell/Shell.cpp
+++ b/Userland/Shell/Shell.cpp
@@ -15,6 +15,7 @@
#include <AK/ScopedValueRollback.h>
#include <AK/StringBuilder.h>
#include <AK/TemporaryChange.h>
+#include <AK/URL.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/DirIterator.h>
#include <LibCore/Event.h>
@@ -66,7 +67,8 @@ void Shell::print_path(const String& path)
printf("%s", path.characters());
return;
}
- printf("\033]8;;file://%s%s\033\\%s\033]8;;\033\\", hostname, path.characters(), path.characters());
+ auto url = URL::create_with_file_scheme(path, {}, hostname);
+ out("\033]8;;{}\033\\{}\033]8;;\033\\", url.serialize(), path);
}
String Shell::prompt() const