diff --git a/src/shell/scripts/omp.lua b/src/shell/scripts/omp.lua index 5ea46270..7dea9eb4 100644 --- a/src/shell/scripts/omp.lua +++ b/src/shell/scripts/omp.lua @@ -6,6 +6,18 @@ if '::UPGRADE::' == 'true' then print(notice) end +-- Cache PID + +function generateCustomUUID() + local template = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' + return string.gsub(template, '[x]', function(c) + local v = math.random(0, 0xf) + return string.format('%x', v) + end) +end + +os.setenv("POSH_PID", generateCustomUUID()) + -- Helper functions local function get_priority_number(name, default) @@ -25,11 +37,11 @@ local function get_priority_number(name, default) return default end end - +os.setenv("POSH_CURSOR_LINE", console.getnumlines()) -- Environment variables local function environment_onbeginedit() - os.setenv("POSH_CURSOR_LINE", console.getnumlines()) + end -- Local state