瀏覽代碼

WebServer: Make bound socket a clickable hyperlink :^)

This patch adds a hyperlink that can be hovered over and clicked on to
open the WebServer's index page in Browser.
networkException 2 年之前
父節點
當前提交
707b4f83eb
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      Userland/Services/WebServer/main.cpp

+ 4 - 1
Userland/Services/WebServer/main.cpp

@@ -92,7 +92,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 
     TRY(server->listen(ipv4_address.value(), port));
 
-    outln("Listening on {}:{}", ipv4_address.value(), port);
+    out("Listening on ");
+    out("\033]8;;http://{}:{}\033\\", ipv4_address.value(), port);
+    out("{}:{}", ipv4_address.value(), port);
+    outln("\033]8;;\033\\");
 
     TRY(Core::System::unveil("/etc/timezone", "r"));
     TRY(Core::System::unveil("/res/icons", "r"));