Skip to content

Commit c71427e

Browse files
committed
fix {EESSI/...} prefix for complex prompts
1 parent 4c81f00 commit c71427e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

init/modules/EESSI/2023.06.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,13 @@ local quiet_load = false
222222
if os.getenv("EESSI_MODULE_UPDATE_PS1") then
223223
local prompt = os.getenv("PS1")
224224
if prompt then
225-
pushenv("PS1", "{EESSI/" .. eessi_version .. "} " .. prompt)
225+
if mode() == "load" then
226+
-- Prepend prefix to PS1 without evaluating its contents
227+
execute{cmd="PS1='" .. prefix .. "'\"$PS1\"", modeA={"load"}}
228+
elseif mode() == "unload" then
229+
-- Strip the prefix from beginning of PS1
230+
execute{cmd="PS1=\"${PS1#'" .. prefix .. "'}\"", modeA={"unload"}}
231+
end
226232
end
227233
end
228234

0 commit comments

Comments
 (0)