mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-13 17:28:52 -04:00
improve /mnt and PS1 conformity
filesystem: don't mount tmpfs in /mnt shell: remove trailing slash for pwd ps1: make the default prompt easier to interpret
This commit is contained in:
parent
1279537f8d
commit
462b264f31
@ -22,7 +22,7 @@ local function onInit()
|
||||
end
|
||||
|
||||
local function onComponentAdded(_, address, componentType)
|
||||
if componentType == "filesystem" then
|
||||
if componentType == "filesystem" and require("computer").tmpAddress() ~= address then
|
||||
local proxy = component.proxy(address)
|
||||
if proxy then
|
||||
local name = address:sub(1, 3)
|
||||
|
@ -17,7 +17,7 @@ set HOME=/home
|
||||
set IFS=\
|
||||
set MANPATH=/usr/man:.
|
||||
set PAGER=/bin/more
|
||||
set PS1='$PWD# '
|
||||
set PS1='$PWD # '
|
||||
set PWD=/
|
||||
set SHELL=/bin/sh
|
||||
set LS_COLORS="{FILE=0xFFFFFF,DIR=0x66CCFF,LINK=0xFFAA00,['*.lua']=0x00FF00}"
|
||||
|
@ -127,13 +127,15 @@ function shell.resolveAlias(command, args)
|
||||
end
|
||||
|
||||
function shell.getWorkingDirectory()
|
||||
-- if no env PWD default to /
|
||||
return os.getenv("PWD") or "/"
|
||||
end
|
||||
|
||||
function shell.setWorkingDirectory(dir)
|
||||
checkArg(1, dir, "string")
|
||||
dir = fs.canonical(dir) .. "/"
|
||||
if dir == "//" then dir = "/" end
|
||||
-- ensure at least /
|
||||
-- and remove trailing /
|
||||
dir = fs.canonical(dir):gsub("^$", "/"):gsub("(.)/$", "%1")
|
||||
if fs.isDirectory(dir) then
|
||||
os.setenv("PWD", dir)
|
||||
return true
|
||||
|
Loading…
x
Reference in New Issue
Block a user