380
380
-- run shell
381
381
function _run_shell (envs )
382
382
local shell = os .shell ()
383
+ local args = table .wrap (option .get (" arguments" ))
383
384
if shell == " pwsh" or shell == " powershell" then
384
- os .execv (" pwsh" , option .get (" arguments" ), {envs = envs })
385
+ os .execv (" pwsh" , args , {envs = envs })
386
+ elseif shell == " nu" then
387
+ if # args ~= 0 then
388
+ table.insert (args , 1 , " -c" )
389
+ end
390
+ os .execv (" nu" , args , {envs = envs })
385
391
elseif shell :endswith (" sh" ) then
386
392
local prompt = _get_prompt ()
387
393
local ps1 = os.getenv (" PS1" )
@@ -392,11 +398,11 @@ function _run_shell(envs)
392
398
else
393
399
prompt = prompt .. " > "
394
400
end
395
- os .execv (shell , option . get ( " arguments " ) , {envs = table .join ({PS1 = prompt }, envs )})
401
+ os .execv (shell , args , {envs = table .join ({PS1 = prompt }, envs )})
396
402
elseif shell == " cmd" or is_host (" windows" ) then
397
403
local prompt = _get_prompt ()
398
404
prompt = prompt .. " $P$G"
399
- local args = table .join ({" /k" , " set PROMPT=" .. prompt }, option . get ( " arguments " ) )
405
+ local args = table .join ({" /k" , " set PROMPT=" .. prompt }, args )
400
406
os .execv (" cmd" , args , {envs = envs })
401
407
else
402
408
assert (" shell not found!" )
0 commit comments