From 969fd2e327219ab7eff6b4ad91192c296b17fd8d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 28 Jul 2025 14:13:39 +0200 Subject: [PATCH] Show server PID in settings --- mac/VibeTunnel/Core/Services/BunServer.swift | 5 +++++ mac/VibeTunnel/Core/Services/ServerManager.swift | 5 +++++ .../Views/Settings/DashboardSettingsView.swift | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/mac/VibeTunnel/Core/Services/BunServer.swift b/mac/VibeTunnel/Core/Services/BunServer.swift index 555455ae..4c7d8571 100644 --- a/mac/VibeTunnel/Core/Services/BunServer.swift +++ b/mac/VibeTunnel/Core/Services/BunServer.swift @@ -47,6 +47,11 @@ final class BunServer { var bindAddress: String = "127.0.0.1" + /// The process identifier of the running server, if available + var processIdentifier: Int32? { + process?.processIdentifier + } + /// Local authentication token for bypassing auth on localhost private let localAuthToken: String = { // Generate a secure random token for this session diff --git a/mac/VibeTunnel/Core/Services/ServerManager.swift b/mac/VibeTunnel/Core/Services/ServerManager.swift index 1ef5ae91..8c91202e 100644 --- a/mac/VibeTunnel/Core/Services/ServerManager.swift +++ b/mac/VibeTunnel/Core/Services/ServerManager.swift @@ -101,6 +101,11 @@ class ServerManager { private(set) var isRestarting = false private(set) var lastError: Error? + /// The process ID of the running server, if available + var serverProcessId: Int32? { + bunServer?.processIdentifier + } + /// Track if we're in the middle of handling a crash to prevent multiple restarts private var isHandlingCrash = false /// Number of consecutive crashes for backoff diff --git a/mac/VibeTunnel/Presentation/Views/Settings/DashboardSettingsView.swift b/mac/VibeTunnel/Presentation/Views/Settings/DashboardSettingsView.swift index 8eab2358..d042059f 100644 --- a/mac/VibeTunnel/Presentation/Views/Settings/DashboardSettingsView.swift +++ b/mac/VibeTunnel/Presentation/Views/Settings/DashboardSettingsView.swift @@ -216,6 +216,13 @@ private struct ServerStatusSection: View { .font(.system(.body, design: .monospaced)) } } + + if let pid = serverManager.serverProcessId { + LabeledContent("Process ID") { + Text("\(pid)") + .font(.system(.body, design: .monospaced)) + } + } } Divider()