From ea78d83363373ebb8c78dc6c1d62959df0a60fae Mon Sep 17 00:00:00 2001 From: Haroon Qureshi Date: Mon, 1 Dec 2025 02:41:01 -0800 Subject: [PATCH] Use working directory if no HOME path specified. PiperOrigin-RevId: 838680600 Change-Id: I8869da40042bb0b4edcbfe1e626c3188d0631c5e --- src/experimental/studio/main.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/experimental/studio/main.cc b/src/experimental/studio/main.cc index 5565e85e..41503669 100644 --- a/src/experimental/studio/main.cc +++ b/src/experimental/studio/main.cc @@ -46,9 +46,11 @@ static std::vector LoadAsset(std::string_view path) { int main(int argc, char** argv, char** envp) { + const char* home = getenv("HOME"); + const std::string ini_path = std::string(home ? home : ".") + "/.mujoco.ini"; + const int width = absl::GetFlag(FLAGS_window_width); const int height = absl::GetFlag(FLAGS_window_height); - const std::string ini_path = std::string(getenv("HOME")) + "/.mujoco.ini"; mujoco::studio::App app(width, height, ini_path, LoadAsset); // If the model file is not specified, try to load it from the first argument