mirror of https://github.com/Hilbis/Hilbish
details: make triangle in prompt change color based on command result
parent
f20be5153f
commit
cb6f17c8fa
|
@ -1,8 +1,21 @@
|
|||
-- Default Hilbish config
|
||||
ansikit = require 'ansikit'
|
||||
bait = require 'bait'
|
||||
|
||||
prompt(ansikit.text(
|
||||
'{blue}%u {cyan}%d {green}∆{reset} '
|
||||
))
|
||||
function doPrompt(fail)
|
||||
prompt(ansikit.text(
|
||||
'{blue}%u {cyan}%d ' .. (fail and '{red}' or '{green}') .. '∆{reset} '
|
||||
))
|
||||
end
|
||||
|
||||
doPrompt()
|
||||
|
||||
bait.catch('command.fail', function()
|
||||
doPrompt(true)
|
||||
end)
|
||||
|
||||
bait.catch('command.success', function()
|
||||
doPrompt()
|
||||
end)
|
||||
|
||||
--hook("tab complete", function ())
|
||||
|
|
Loading…
Reference in New Issue