From c71427e917478c441eda8bb36ac016ad86feac2f Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Fri, 3 Apr 2026 20:16:39 +0200 Subject: [PATCH 1/2] fix {EESSI/...} prefix for complex prompts --- init/modules/EESSI/2023.06.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 3847502e..5ce3706d 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -222,7 +222,13 @@ local quiet_load = false if os.getenv("EESSI_MODULE_UPDATE_PS1") then local prompt = os.getenv("PS1") if prompt then - pushenv("PS1", "{EESSI/" .. eessi_version .. "} " .. prompt) + if mode() == "load" then + -- Prepend prefix to PS1 without evaluating its contents + execute{cmd="PS1='" .. prefix .. "'\"$PS1\"", modeA={"load"}} + elseif mode() == "unload" then + -- Strip the prefix from beginning of PS1 + execute{cmd="PS1=\"${PS1#'" .. prefix .. "'}\"", modeA={"unload"}} + end end end From aa8a19c7b41a31b47d276331437518bd984e67c7 Mon Sep 17 00:00:00 2001 From: Samuel Moors Date: Fri, 3 Apr 2026 20:30:03 +0200 Subject: [PATCH 2/2] define prefix --- init/modules/EESSI/2023.06.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init/modules/EESSI/2023.06.lua b/init/modules/EESSI/2023.06.lua index 5ce3706d..4a959fb6 100644 --- a/init/modules/EESSI/2023.06.lua +++ b/init/modules/EESSI/2023.06.lua @@ -222,6 +222,7 @@ local quiet_load = false if os.getenv("EESSI_MODULE_UPDATE_PS1") then local prompt = os.getenv("PS1") if prompt then + local prefix = "{EESSI/" .. eessi_version .. "} " if mode() == "load" then -- Prepend prefix to PS1 without evaluating its contents execute{cmd="PS1='" .. prefix .. "'\"$PS1\"", modeA={"load"}}