Giving a clearer error message if programs cannot be started because the set shell cannot be found, closes #470.

This commit is contained in:
Florian Nücke 2014-08-06 13:29:49 +02:00
parent a08fa3be5d
commit 16d0062a9f

View File

@ -11,7 +11,11 @@ local aliases = {}
local shells = setmetatable({}, {__mode="v"}) local shells = setmetatable({}, {__mode="v"})
local function getShell() local function getShell()
local shellName = shell.resolve(os.getenv("SHELL"), "lua") local shellPath = os.getenv("SHELL") or "/bin/sh"
local shellName, reason = shell.resolve(shellPath, "lua")
if not shellName then
return nil, "cannot resolve shell `" .. shellPath .. "': " .. reason
end
if shells[shellName] then if shells[shellName] then
return shells[shellName] return shells[shellName]
end end