2021-03-20 00:28:22 +00:00
|
|
|
-- Default Hilbish config
|
2021-03-21 07:05:39 +00:00
|
|
|
ansikit = require 'ansikit'
|
2021-03-30 23:48:37 +00:00
|
|
|
bait = require 'bait'
|
2021-03-20 22:51:51 +00:00
|
|
|
|
2021-03-30 23:48:37 +00:00
|
|
|
function doPrompt(fail)
|
2021-04-05 21:27:55 +00:00
|
|
|
prompt(ansikit.format(
|
2021-03-30 23:48:37 +00:00
|
|
|
'{blue}%u {cyan}%d ' .. (fail and '{red}' or '{green}') .. '∆{reset} '
|
|
|
|
))
|
|
|
|
end
|
|
|
|
|
2021-04-07 13:10:11 +00:00
|
|
|
print(ansikit.format('Welcome to {magenta}Hilbish{reset} {cyan}'.. os.getenv 'USER' ..
|
|
|
|
'{reset}.\n' ..
|
|
|
|
'The nice lil shell for {blue}Lua{reset} fanatics!\n'))
|
2021-04-03 17:14:14 +00:00
|
|
|
|
2021-03-30 23:48:37 +00:00
|
|
|
doPrompt()
|
|
|
|
|
2021-04-05 21:27:55 +00:00
|
|
|
bait.catch('command.exit', function(code)
|
|
|
|
doPrompt(code ~= 0)
|
2021-03-30 23:48:37 +00:00
|
|
|
end)
|
2021-03-20 22:51:51 +00:00
|
|
|
|
|
|
|
--hook("tab complete", function ())
|