Hilbish/nature/commands/fg.lua

16 lines
280 B
Lua
Raw Normal View History

2022-05-24 22:07:31 +00:00
local commander = require 'commander'
commander.register('fg', function()
local job = hilbish.jobs.last()
if not job then
print 'fg: no last job'
return 1
end
local err = job.foreground() -- waits for job; blocks
if err then
print('fg: ' .. err)
return 2
end
end)